devxlogo

Java

Image

Understanding the Double Colon in Java

Iterating a list and printing the values is very simple, as illustrated by the code snippet below. import java.util.*;public class DoubleColon{ public static void main(String args[]) { DoubleColon doubleColon =

Image

Understanding the Usage of the OffsetDateTime Class

This class belong to java.time package. There are many options available, but here we will be using the ZoneId to get the current time. import java.time.*;public class UsingOffsetDateTime{ public static

Image

Dangers of Choosing the Wrong Class Loader

This code uses the class loader that loads the current class and getClass() could return something unexpected, like a subclass, or a dynamic proxy. This is hardly ever what you

Image

Explore the Java Collections Rotate Method

See how to use the rotate method in Collections to rotate the elements to a specified position. import java.util.*;public class UsingRotateInCollections { public static void main(String args[]) { UsingRotateInCollections usingRotateInCollections

Image

Understanding LineNumberReader

LineNumberReader is a cool class in Java from which numerous line related tasks can be performed: import java.io.FileReader;import java.io.LineNumberReader;import java.io.IOException;public class UsingLineNumberReader { public static void main(String args[]) { UsingLineNumberReader

Image

Understanding CopyOnWriteArrayList

In CopyOnWriteArrayList, operations such as add, remove, etc., are implemented on a copy of the of the array. It definitely impacts performance but the trade-off is that the data remains

Image

How to Diagnose an OutofMemoryError in Android

Diagnosing OutofMemoryError in Android apps can become a tricky, tedious job. Here, we would like to show you an easy technique to troubleshoot OutOfMemoryError in Android apps. BuggyApp To facilitate this exercise,