|
1. What is garbage collection? Garbage Collection is a thread that runs to reclaim the memory by destroying the objects that cannot be referenced anymore. 2. What is index table and why we use it? Index table are based on a sorted ordering of the values. Index table provides fast access time when searching. 3. What is meant by a Thread? Thread is defined as an instantiated parallel process of a given program. 4. What is method overriding? Overriding has same method name, identical arguments used in subclass. 5. What do mean by polymorphisum, inheritance, encapsulation? Polymorhisum : is a feature of OOPl that at run time depending upon the type of object the appropriate method is called. Inheritance : is a feature of OOPL that represents the "is a" relationship between different objects(classes). Say in real life a manager is a employee. So in OOPL manger class is inherited from the employee class. Encapsulation : is a feature of OOPL that is used to hide the information. 6. What is a super class and how can you call a super class? When a class is extended that is derived from another class there is a relationship is created, the parent class is referred to as the super class by the derived class that is the child. The derived class can make a call to the super class using the keyword super. If used in the constructor of the derived class it has to be the first statement. 7. What is singleton class? Singleton class means that any given time only one instance of the class is present, in one JVM. 8. What do you mean by virtual methods? Virtual methods are used to use the polymorhism feature in C++. Say class A is inherited from class B. If we declare say fuction f() as virtual in class B and override the same function in class A then at runtime appropriate method of the class will be called depending upon the type of the object. 9. Can you write Java code for declaration of multiple inheritance in Java ? Class C extends A implements B { } 10. What is a constructor? In Java, the class designer can guarantee initialization of every object by providing a special method called a constructor. If a class has a constructor, Java automatically calls that constructor when an object is created, before users can even get their hands on it. So initialization is guaranteed.
|