Skip to content

Category Archives: Java

In Java, if there is a local variable in a method with same name as instance variable, then the local variable hides the instance variable.… Read More
We know that a Java code begins to execute from the main method. During runtime, if JVM can’t find any main method then we will… Read More
Consider following program. Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java… Read More
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 which is used to examine or modify the behavior of methods, classes, interfaces at runtime. The required classes for reflection are… 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
Consider below Java program. Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java… Read More
An assertion allows testing the correctness of any assumptions that have been made in the program. Assertion is achieved using the assert statement in Java.… 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

Start Your Coding Journey Now!