Browsing Category
Java
Description of Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible. Java is a general-purpose programming language that is class-based, object-
Java String compareTo() Function: Complete Guide
The String compareTo() method compares the two strings lexicographically. Each character of both the strings is converted into the Unicode value for comparison. If both strings are equal, this method returns 0; otherwise, it returns the…
Iterators in Java: The Complete Guide
Every collection provides an iterator, which allows the Java programmer to access elements of any collection using the methods defined in the Iterator interface.
Iterators in Java
The iterators in Java can be thought of as a…
Java Static Keyword: The Complete Guide
The main method of a class in Java is generally labeled static. Java Static keyword is used for a constant variable or a method that is the same for every class instance. Let's deep dive into static keyword and see some examples.
Java…
Java Lambda Expressions: A Brief Introduction
Lambda expressions are also known as closures. They are used to call methods objects.
The lambda expressions are added in Java 8 and provide the below functionalities.
It enables to treat functionality as the method argument or code…
TreeMap in Java: The Complete Guide
The elements stored in the TreeMap are sorted according to the keys natural ordering by default. The elements stored in TreeMap are unique. It can have multiple null values, but it does not allow a null key.
TreeMap in Java
Java TreeMap…
Java File Class Tutorial: The Complete Guide
Java File class represents the path of directories and files. The File class is the wrapper class for the file name and its directory path.
Java File Class
File class in Java is a representation of the file or directory pathname. It…
Polymorphism in Java: Step by Step Guide
Polymorphism comes from two Greek words poly means many, and morph means shape or type. So Polymorphism can be defined as a word that can be displayed in different/many forms. But in the case of Java, it is an operator or the constructor or…
Java Switch Statement: Complete Example
The switch statement is the multi-way branch statement. It provides an easy way to dispatch execution to different parts of code based on the value of the expression.
Java Switch
Java switch statement executes one statement from the…
Sorting in Java: The Complete Guide
For sorting an array of objects/primitive data types, Java defined a method Arrays.sort(). While working on the List collections in Java (like LinkedList, Queue, ArrayList, etc.), we have a method Collections.sort().
Both of the methods…
Java Anonymous Inner Class: Complete Guide
Java Anonymous Inner Class is an Inactive class (non-static nested class) with no name. It is used in Java to override the methods of interface and classes. Unlike other classes, it does not have any constructor (as the name of a…
Java Operators in 2022: The Complete Guide
Java operators are the symbols in java that are used to perform an operation on variable and their values.
Java Operators
Operators in Java are used to performing operations on variables and values. A value is called an operand, while…