Skip to content

Category Archives: Java

Prerequisite: Collection in Java Following are the 4 ways to retrieve any elements from a collection object:   For-each For each loop is meant for traversing items… Read More
A new feature was introduced by JDK 7 which allows writing numeric literals using the underscore character. Basically, they are broken to enhance readability. This feature… Read More
Variable Arguments (Varargs) in Java is a method that takes a variable number of arguments. Variable Arguments in Java simplifies the creation of methods that… Read More
Reflection is an API that is used to examine or modify the behavior of methods, classes, and interfaces at runtime. The required classes for reflection… Read More
String is a sequence of characters. In java, objects of String are immutable which means a constant and cannot be changed once created. Creating a… Read More
Background : Iterator is an interface provided by collection framework to traverse a collection and for a sequential access of items in the collection.   // Iterating… Read More
This is a question asked quite often as in which language should be preferred to be efficient in competitive programming. It is something one should… Read More
The HashSet class implements the Set interface, backed by a hash table which is actually a HashMap instance. No guarantee is made as to the… Read More
In Java, an immutable class is a class (Integer, Byte, Long, Float, Double, Character, Boolean, and Short) which once created then its body can not… Read More
An assertion allows testing the correctness of any assumptions that have been made in the program. An assertion is achieved using the assert statement in… Read More
Any group of individual objects which are represented as a single unit is known as the collection of the objects. In Java, a separate framework… Read More
In C++, we have std::pair in the utility library which is of immense use if we want to keep a pair of values together. We… Read More
  Why is Java called the ‘Platform Independent Programming Language’?    Platform independence means that execution of your program does not dependent on type of… Read More
Generics means parameterized types. The idea is to allow type (Integer, String, … etc., and user-defined types) to be a parameter to methods, classes, and… Read More
Garbage collection in Java is the process by which Java programs perform automatic memory management. Java programs compile to bytecode that can be run on… Read More

Start Your Coding Journey Now!