Category: JAVA

Commonly asked programs in java interview

  Permutaion of word for ex ABC will be abc , acb,bac,bca,cab,cba public class Permutation { public static void main(String[] args) {     String s=”abc”;     List<String>combinations=new ArrayList<String>();     combinations=permutations(s);     System.out.println(combinations); }   private static List<String> permutations(String s) {     // TODO Auto-generated method stub     List<String>combinations=new ArrayList<String>(); […]

Singleton class in java

What is Singleton class in java? Have you used Singleton before? Singleton is a class which has only one instance in whole application and provides a getInstance() method to access the singleton instance. There are many classes in JDK which is implemented using Singleton pattern like java.lang.Runtime which provides getRuntime() method to get access of […]

Immutability in Java

what is Immutability in Java ? What does immutable mean? Why it is being used? Lets learn it in this post.   Immutable: Immutable means once we create we cannot changed its content. Immutable object: Once you create a object, you can’t modify the contents of that object. why? — to make things thread safe […]

Inheritance Interview Question in java

Please find below the list of Inheritance Interview Question in java: 1) What do you mean by inheritance.? Inheritance is one of the key features of object oriented programming. Through inheritance, a class (Sub Class) can inherit properties of another class (Super Class). Sub class can have it’s own properties along with the inherited properties […]

Exception Interview Questions

Please find below the list of Exception Interview Questions – 1) What is an Exception? An exception is an abnormal condition that arises in a code sequence at run time. In other words, an exception is a run-time error. 2) What is a Java Exception? A Java exception is an object that describes an exceptional […]

Main Method Interview Question in java

Please find the list of Main Method Interview Question in java : What is the main method in Java? Main method in Java is entry point for any Java program.In core Java program, execution starts from main method when you type java main-class-name, JVM search for public static void main(String args[]) method in that class […]