Blog Archives

3 Java class loading interview Q&As

Q1. What do you know about Java class loading? Explain Java class loaders?
A1. Class loaders are hierarchical. Classes are introduced into the JVM as they are referenced by name in a class that is already running in the JVM. So, how is the very first class loaded? The very first class is specially loaded with the help of static main( ) method declared in your class. All the subsequently loaded classes are loaded by the classes, which are already loaded and running. A class loader creates a namespace. All JVMs include at least one class loader that is embedded …

Java abstract classes Vs interfaces Interview Q&As

Q1. When to use an abstract class over an interface? Q2. What is a diamond problem? Q3. Does Java support multiple inheritance? In design, you want the base class to present only an interface (or a contract) for its derived classes. This means, you don’t want anyone to actually instantiate…

Java classes and interfaces are the building blocks

Q1. Which class declaration is correct if A and B are classes and C and D are interfaces? a) class Z extends A implements C, D{} b) class Z extends A,B implements D {} c) class Z extends C implements A,B {} d) class Z extends C,D implements B {}…

Tags: , ,

300+ Java & Big Data FAQs - Quick Prep

Java & Big Data Tutorials