Flatten a Stream of Arrays in Java using forEach loop
Given a Stream of Arrays in Java, the task is to Flatten the Stream using forEach() method. Examples: Input: arr[][] = {{ 1, 2 },… Read More »
| Recent Articles |
| MCQ / Quizzes |
| Java Collections |
| Practice Problems |
| Commonly Asked Questions Set 1 & Set 2 |
Given a Stream of Arrays in Java, the task is to Flatten the Stream using forEach() method. Examples: Input: arr[][] = {{ 1, 2 },… Read More »
Given a Stream of Lists in Java, the task is to Flatten the Stream using forEach() method. Examples: Input: lists = [ [1, 2], [3,… Read More »
Given a Stream of Map in Java, the task is to Flatten the Stream using forEach() method. Examples: Input: map = {1=[1, 2], 2=[3, 4,… Read More »
Given a Map with null values in it, the task is to replace all the null values with a default value. Examples: Input: map =… Read More »
Introduced in Java 8, the Stream API is used to process collections of objects. A stream is a sequence of objects that supports various methods… Read More »
Prerequisite: Comparator Interface in Java, TreeSet in Java The compare() method in Java compares two class specific objects (x, y) given as parameters. It returns… Read More »
The addSuppressed?(Throwable exception) method of a Throwable class used to append the exception to the exceptions that were suppressed in order to deliver this exception.… Read More »
The setStackTrace(StackTraceElement[] stackTrace) method of Throwable class is used to Set the stack trace elements to this throwable object and this stack trace will be… Read More »
The AbstractSet.equals() method in Java AbstractSet is used to check for equality between two sets. It verifies whether the elements of one set passed as… Read More »
The removeAll() method of Java.util.AbstractSet class is used to remove from this set all of its elements that are contained in the specified collection. Syntax:… Read More »
The AbstractSet.hashCode() method in Java AbstractSet is used to fetch the hash code value of a particular this AbstractSet. A set consists of a number… Read More »
The toString() method of Java.lang.Throwable class used to return a String representation of this Throwable which consists of the name of the class of this… Read More »
printStackTrace() The printStackTrace() method of Java.lang.Throwable class used to print this Throwable along with other details like class name and line number where the exception… Read More »
The floatToIntBits() method in Float Class is a built-in function in java that returns a representation of the specified floating-point value according to the IEEE… Read More »
The floatToRawIntBits() method in Float Class is a built-in function in java that returns a representation of the specified floating-point value according to the IEEE… Read More »