Master List Of Core Java Questions
- OOPS
- What is an Object?
- What is a Class?
- What is OOAD?
- What is Data Abstraction ?
- What is Data Encapsulation?
- What is the difference between Data Abstraction and Information Hiding?
- What is Inheritance and what are different types of it?
- Why Java uses Singly rooted hierarchy?
- Why does Java not support Multiple Inheritance?
- Why is Java not 100% pure OOP language?
- What is Early Binding?
- What is Polymorphism/Late Binding?
- What is method overloading?
- What is method overriding?
- How is Java different from C++?
- What is UML and how is it useful in designing large systems?
- Is UML useful for procedural programming ?
- What are different notations used in UML ?
- What is a Use case and an Actor?
- How to identify an Actor?
- What is Generalization?
- What is Association and how it maps into a Java class?
- What is Aggregation and how it maps into a Java class?
- What is Composition and how it maps into a Java class?
- What is Dependency and how it maps into a Java class?
- What is the purpose of State machine diagrams?
- What are different kinds of Structure diagrams?
- What are different kinds of Interaction diagrams?
- What are different kinds of Behavior diagrams?
- What is a Java Virtual Machine (JVM)?
- What is a JVM consisted of?
- What is a class loader and what is its responsibilities?
- What is heap and stack?
- How is your Java program executed inside JVM?
- What is Java class file's magic number?
- How JVM performs Thread Synchronization?
- How JVM performs Garbage Collection?
- How to profile heap usage?
- What will you do if VM exits while printing "OutOfMemoryError" and increasing max heap size doesn't help?
- Should one pool objects to help Garbage Collector?Should one call System.gc() periodically?
- An application has a lot of threads and is running out of memory, why?
- If your program is I/O bound or running in native methods, do these activities engage JVM?
- What is the difference between interpreted code and compiled code?
- Why Java based GUI intensive program has performance issues?
- What is 64 bit Java ?
- What is the difference between JVM and JRE?
- What are different primitive datatypes in Java?
- What are expressions,statements and blocks in Java?
- What is a transient variable?
- What is the difference between the '&' operator and the '&&' operator?
- Why main method of Java has public static void?
- If you have static block, constructor and main method in Java file then what will be the sequence of method calls?
- What are the command line arguments?
- Does Java support multi dimensional arrays?
- What are the restrictions for static method?
- Why a abstract method cannot be static?
- Is 'sizeof' a keyword?
- What is the precedence of operators in Java?
- How is an argument passed in Java methods?
- What is the difference between class variable, member variable and automatic(local) variable?
- When are static and non static variables of a class initialized?
- Can shift operators be applied to float types?
- What are different Java declarations and their associated rules?
- What are Java Modifiers?
- Explain final modifier.
- Can you change the reference of the final object?
- Can abstract class be instantiated?
- When does the compiler insist that the class must be abstract?
- Where can static modifiers be used?
- What is static initializer code?
- Can an anonymous class implement an interface and extend a class at the same time?
- What are volatile variables?
- Can protected or friendly features be accessed from different packages?
- How many ways can one write an infinite loop?
- When do you use 'continue' and 'break' statements?
- What is the difference between 'while' and 'do while' loop?
- What is an Assertion and why using assertion in your program is a good idea ?
- Explain Assertions with a code exmaple.
- How many forms of assertions we have?
- When assertions should be avoided?
- What situations are best suitable for implementing assertions?
- What is Exception ?
- What is a user-defined exception?
- What do you know about the garbage collector?
- Why Java does not support pointers?
- Does garbage collection guarantee that a program will not run out of memory?
- What is finally in Exception handling?
- What can prevent the execution of the code in finally block?
- Explain 'try','catch' and 'finally' blocks?
- Define Checked and Unchecked exception.
- What is the difference between an abstract class and an interface?
- What is the use of interface?
- What is serializable interface?
- Does a class inherit constructors from its superclass?
- What's the difference between constructors and other methods?
- If the method to be overridden has access type 'protected', can subclass have the access type as 'private'?
- If you use super() or this() in a constructor where should it appear in the constructor?
- What modifiers may be used with an inner class that is a member of an outer class?
- Can an inner class be defined inside a method?
- What is an anonymous class?
- What is a thread?
- What is the difference between process and threads?
- What are two types of multitasking?
- What are two ways of creating threads in Java and why so?
- How does multithreading take place on a computer with a single CPU?
- How a Java object be locked for exclusive use by a given thread?
- What is Synchronization?
- Explain wait(),notify(), and notifyAll() methods?
- What is a Daemon thread?
- How a dead thread can be started?
- What is the difference between String and StringBuffer?
- How is '==' different from .equals() method in case of String objects?
- Explain StreamTokenizer?
- What is Collection?
- Explain List,Set and Map.
- What is the serialization?
- What is the difference between Serializable and Externalizable interface?
- What is memory leak?
- Difference between ArrayList and Vector class?
- What is the difference between Hashtable and HashMap?
- What is JFC?
- What is the difference between JFC Swing and AWT?
- What is the base class for all swing components?
- What are lightweight and heavyweight components ?
- How can a GUI component handle its own events?
- What is a Layout Manager and what are its different types and their advantages?
- How are the elements of a GridBagLayout organized?
- What are the problems faced by Java programmers in absence of layout managers?
- Where the CardLayout is used?
- What is the difference between GridLayout and GridBagLayout?
- How will you add a panel to a frame?
- What is the difference between Application and Applet?
- Explain Lifecycle of the Applet and what is the order of method invocation in an applet?
- What is the difference between Java class and bean?
- What is difference between trusted and untrusted applet?
- How do you set Java Library path programmatically?
- Explain the usage of java.util.Date and more classes and APIs for date handling in Java?
- What is JDBC ?
- What are four drivers available in JDBC?
- How do you establish database connection using JDBC?
- How do you connect to a MySql Database using JDBC?
- What are the different types of Statements?
- What is PreparedStatement and how is different from Statement?
- What is the difference between executeQuery () and execute() ?
- What is the difference between executeQuery () and executeUpdate()?
- How do you call a stored procedure in Java?
- What are new features from JDBC2.0 onwards?
- How can a cursor move in scrollable result sets?
- Differentiate TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE?
- How will you differentiate the following two ways of loading a database driver?
- How can you display a particular web page from an applet?
- How can you get the hostname on the basis of IP addres ?
- How can you get an IP address of a machine from its hostname?
- How do you know who is accessing your server?
- What are different socket options?
- What should I use a ServerSocket or DatagramSocket in my applications?
Java Fundamentals
JDBC