Category Archives

Flattening Nested Collections in Java

A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired...

Flattening Nested Collections in Java

A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired...

ArrayList to Array Conversion in Java : toArray() Methods

Following methods can be used for converting ArrayList to Array: arraylist-to-array Method 1: Using Object toArray() method Syntax: public...

ArrayList to Array Conversion in Java : toArray() Methods

Following methods can be used for converting ArrayList to Array: arraylist-to-array Method 1: Using Object toArray() method Syntax: public...

How to compare two arrays in Java?

Predict the output of following Java program. class Test { public static void main (String args) { int arr1...

How to compare two arrays in Java?

Predict the output of following Java program. class Test { public static void main (String args) { int arr1...

Array vs ArrayList in Java

In Java, following are two different ways to create an array. Array: Simple fixed sized arrays that we create...

Array vs ArrayList in Java

In Java, following are two different ways to create an array. Array: Simple fixed sized arrays that we create...

Jagged Array in Java

A jagged array is an array of arrays such that member arrays can be of different sizes, i.e., we...

Jagged Array in Java

A jagged array is an array of arrays such that member arrays can be of different sizes, i.e., we...

Interesting facts about Array assignment in Java

While working with arrays we have to do 3 tasks namely declaration, creation, initialization or Assignment. Declaration of array...

Interesting facts about Array assignment in Java

While working with arrays we have to do 3 tasks namely declaration, creation, initialization or Assignment. Declaration of array...

Final arrays in Java

Predict the output of following Java program. class Test { public static void main(String args) { final int arr...

Final arrays in Java

Predict the output of following Java program. class Test { public static void main(String args) { final int arr...