Object Oriented Programming Using JAVA (IT-406)
SECTION I – Short Questions
Q1. Use of this keyword:
The this keyword refers to the current object of a class. It is used to differentiate instance variables
from local variables.
Q2. Java statement for array of size 20:
int[] arr = new int[20];
Q3. Use of final and super:
final prevents modification. super refers to parent class members.
Q4. Compile and run commands:
javac [Link]
java MyProgram
Q5. Why Java is secure:
No pointers, JVM sandbox, automatic garbage collection.
Q6. Method Overloading vs Overriding:
Overloading occurs in same class; overriding requires inheritance.
Q7. is-a vs has-a:
is-a uses inheritance; has-a uses association.
Q8. Garbage Collector:
Automatically removes unused objects from memory.
Q9. Abstract Method Rule:
Class must be abstract if it contains abstract method.
Q10. Early vs Late Binding:
Early binding is compile time; late binding is runtime.
SECTION II – Long Questions
Advantages of OOP:
Reusability, security, maintainability.
Employee Tax Program (Java):
Abstract class Employee with subclasses Manager (10%), Programmer (15%), Teacher (20%).