JAVA UNIT–1 & UNIT–2 COMPLETE ANSWERS
UNIT – 1
1. Java Buzzwords:
Simple, Object Oriented, Platform Independent, Secure, Robust, Multithreaded, Portable, High
Performance, Distributed, Dynamic.
2. OOP Features:
Encapsulation, Abstraction, Inheritance, Polymorphism, Class & Object.
3. Variable:
A variable stores data.
Types: Local, Instance, Static.
4. Control Statements:
Selection (if, switch), Looping (for, while), Jumping (break, continue).
5. Data Types:
Primitive: int, float, double, char, boolean.
Non-Primitive: String, Array, Class.
6. Class & Object:
Class is blueprint, Object is instance.
7. Overloading:
Same method name, different parameters.
8. Garbage Collection & Recursion:
GC deletes unused objects. Recursion is function calling itself.
9. Matrix Program:
Addition and multiplication using loops.
10. Type Conversion:
Implicit and Explicit casting.
11. Class vs Method:
Class is blueprint, method performs task.
12. Inner Class:
Member, Static, Local, Anonymous.
UNIT – 2
1. Inheritance:
Acquiring properties of another class.
2. Types of Inheritance:
Single, Multilevel, Hierarchical.
3. Access Control:
public, protected, default, private.
4. super & final:
super accesses parent class.
final prevents inheritance.
5. Polymorphism:
Compile time & Run time.
6. Abstraction:
Using abstract class and method.
7. Package & Classpath:
Package groups classes.
Classpath tells JVM where classes exist.
8. Class vs Interface:
Class uses extends.
Interface uses implements.
9. Interface:
Defines abstract methods.
10. [Link] Package:
Used for input/output operations.