Category Archives: Java

Commonly Asked Java Programming Interview Questions | Set 2

Frequently Asked Java Interview Questions | Set 1 Can we Overload or Override static methods in java ? Overriding : Overriding is related to run-time polymorphism. A subclass (or derived class) provides a specific implementation of a method in superclass (or base class) at runtime. Overloading: Overloading is related to compile time (or static) polymorphism.… Read More »



See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.

Socket Programming in Java

This article describes a very basic one-way Client and Server setup where a Client connects, sends messages to server and the server shows them using socket connection. There’s a lot of low-level stuff that needs to happen for these things to work but the Java API networking package (java.net) takes care of all of that, making network… Read More »



See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.

TreeSet in Java

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 in sorted format.Following are the features of TreeSet. TreeSet uses tree data structure for storage. Objects are stored in sorted, ascending order. But we can iterate in descending order using… Read More »



See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.

Interfaces in Java

Like a class, an interface can have methods and variables, but the methods declared in interface are by default abstract (only method signature, no body).   Interfaces specify what a class must do and not how. It is the blueprint of the class. An Interface is about capabilities like a Player may be an interface… Read More »



See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.

PriorityQueue Class in Java

To process the objects in the queue based on the priority, we tend to use Priority Queue. Important points about Priority Queue: PriorityQueue doesn’t allow null We can’t create PriorityQueue of Objects that are non-comparable The elements of the priority queue are ordered according to their natural ordering, or by a Comparator provided at queue… Read More »



See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.

Synchronized in Java

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 it needs to be made sure by some synchronization method that only one thread can access the resource at a given point of time. Java provides a way of creating… Read More »



See Placement Course for placement preparation, GATE Corner for GATE CS Preparation and Quiz Corner for all Quizzes on GeeksQuiz.