Assignment title: Information
OOP (Programming)(1*2 = 2)
1. Instance variables and local variables are one and the same.
2. Static method's body can use "this" reference of calling object.
3. If the default constructor is not available in a class, then the object of that class cannot be created.
4. Composition is referred as 'is-a" relationship.
5. Protected instance variables of a class are accessible only in its sub classes.
6. Private and public members of super class are inherited in sub classes. Hence, a subclass can access private instance members of its super class.
7. @override is used to say that the super class's method is being overloaded in the subclass.
8. A sub class reference variable can refer to an object of its super class.
9. Irrespective of the presence of any constructor in a class, the compiler will provide a default constructor.
10. The key word "final" can be used only for static variables.
11. Out of many different constructor of super class, only the default constructor is inherited by sub class.
12. A static variable will store all the instance variables of class.
13. An abstract class and an interface can be used interchangeably.
14. A final class can have sub classes.
15. If there is a try block in a program then there must be an exception block and also a finally block in the same program.
16. A subclass can inherit properties from one super class only.
17. A recursive method may call another method, which may in turn make a call back to the recursive method (itself). This is known as direct recursion or direct recursive call.
18. Stack is "first in first out" whereas queue is "last in first out".
19. Public class ClassB implements ClassC, ClassD.
From the above java code fragment, we can say that ClassC is super class; ClassD is sub class; ClassB is interface.
20. A class can implement only one interface.
21. Selecting a radio button forces all other radio buttons in the same group to be deselected.
22. What role(s) does abstraction play in object-oriented programming?