Skip to content

Category Archives: Java

A final variable in Java can be assigned a value only once, we can assign a value either in declaration or later. final int i… Read More
Static Binding: The binding which can be resolved at compile time by compiler is known as static or early binding. Binding of all the static, private… Read More
This article describes a very basic one-way Client and Server setup where a Client connects, sends messages to the server and the server shows them using… Read More
TreeSet provides an implementation of the SortedSet Interface and SortedSet extends Set Interface. It behaves like simple set with the exception that it stores elements… Read More
Background All the objects which are created dynamically (using new in C++ and Java) are allocated memory in the heap. If we go on creating… Read More
Scanner class in Java supports nextInt(), nextLong(), nextDouble() etc. But there is no nextChar() (See this for examples) To read a char, we use next().charAt(0).… Read More
The first lecture note given during java class is “In java file name and class name should be the same”. When the above law is… Read More
  Java provides two interfaces to sort objects using data members of the class:   Comparable Comparator  Attention reader! Don’t stop learning now. Get hold of… Read More
This class represents an IP address. It represents both the 32 bit IPv4 address and 128 bit IPv6 address. It is the superclass of Inet6Address… Read More
Like a class, an interface can have methods and variables, but the methods declared in an interface are by default abstract (only method signature, no… Read More
A PriorityQueue is used when the objects are supposed to be processed based on the priority. It is known that a Queue follows the First-In-First-Out… Read More
Multi-threaded programs may often come to a situation where multiple threads try to access the same resources and finally produce erroneous and unforeseen results.   So… Read More
Using Java in competitive programming is not something many people would suggest just because of its slow input and output, and well indeed it is… Read More
StringBuffer is a peer class of String that provides much of the functionality of strings. The string represents fixed-length, immutable character sequences while StringBuffer represents… Read More
Try to figure out the output of this code:Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts… Read More