The array is a data structure which stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type. Array in …
Read More »How to get current date time in java
Java provides the Date class available in java.util package, this class encapsulates the current date and time.You can also use Calendar class to get current date and time. Getting Current Date & Time This is very easy to get current date and time in Java. You can use a simple …
Read More »Wrapper class in Java
Wrapper classes are used to convert primitive into object and object into primitive. Each of Java’s eight primitive data types has a class dedicated to it. These are known as wrapper classes, because they “wrap” the primitive data type into an object of that class. The primitive data types are …
Read More »Static Binding and Dynamic Binding in Java
Connecting a method call to the method body is known as binding. There are two types of binding static binding (also known as early binding). dynamic binding (also known as late binding). 1. Static binding or Early binding Static binding is a binding which happens during compilation. It is also …
Read More »Super keyword in java
Super keyword in java is a reference variable that is used to refer parent class object.Whenever you create the instance of subclass, an instance of parent class is created implicitly i.e. referred by super reference variable. Usage of java super Keyword super is used to refer immediate parent class instance …
Read More »LinkedList in java
The LinkedList class extends AbstractSequentialList and implements the List interface. It provides a linked-list data structure. Java LinkedList class uses doubly linked list to store the elements. It extends the AbstractList class and implements List and Deque interfaces. Java LinkedList class can contain duplicate elements. Java LinkedList class maintains insertion …
Read More »Checked vs Unchecked Exceptions in Java
Checked and Unchecked Exception is two types of Exception exist in Java. Though there is no difference in functionality and you can very achieve same thing with either checked Exception or Unchecked Exception, there is some difference on exception handling part. 1)Checked Exception Exception which are checked at Compile time …
Read More »Difference between throw and throws in Java
There are many differences between throw and throws keywords. A list of differences between throw and throws are given below: 1) You can declare multiple exception thrown by method in throws keyword by separating them in common e.g. throws IOException, ArrayIndexBoundException etc, while you can only throw one instance of …
Read More »ArrayList in Java
The ArrayList class extends AbstractList and implements the List interface. ArrayList supports dynamic arrays that can grow as needed. Standard Java arrays are of a fixed length. After arrays are created, they cannot grow or shrink, which means that you must know in advance how many elements an array will …
Read More »Collections in Java
Collections in java is a framework that provides an architecture to store and manipulate the group of objects.This framework has several useful classes which have tons of useful functions which makes a programmer task super easy. All the operations that you perform on a data such as searching, sorting, insertion, …
Read More »