1. Discuss the various characteristics of object oriented programming concepts.
OOP concepts: Encapsulation, Inheritance, Polymorphism, Abstraction, Classes & Objects.
2. Explain any five features (buzzwords) of Java.
Simple, Object-Oriented, Platform Independent, Secure, Robust, Multithreaded.
3. Explain the importance of 'this' keyword with an example.
'this' refers to the current object; used to resolve ambiguity in variable names.
4. Define method overloading with an example.
Same method name, different parameter list (compile-time polymorphism).
5. What is a constructor? Discuss constructor overloading.
Special method to initialize objects. Overloading: multiple constructors with different parameters.
6. Explain arrays with an example.
Collection of similar data stored in contiguous memory. Example: int a[]={1,2,3};
7. Conditional statements in Java.
if, if-else, nested if, switch-case.
8. Different loop structures in Java.
for, while, do-while, enhanced for-each loop.
9. Use of break and continue.
break → exit loop; continue → skip current iteration.
10. Operators in Java.
Arithmetic, Relational, Logical, Bitwise, Assignment, Unary, Ternary.
11. Type conversion and casting.
Implicit (widening), Explicit (narrowing) using (type).
12. For-each loop example.
Used to iterate over arrays/collections. Example: for(int x: arr) { }.
13. String class methods.
length(), charAt(), substring(), equals(), toUpperCase(), toLowerCase().
14. Primitive data types.
byte, short, int, long, float, double, char, boolean.
15. Inheritances in Java.
Single, Multilevel, Hierarchical (Java does not support multiple inheritance directly).
16. Multiple inheritance in Java.
Achieved using interfaces, not classes.
17. Prime number program.
Check divisibility from 2 to sqrt(n); if divisible → not prime.
18. Switch statement example.
Switch executes one case based on value; uses break to stop fall-through.
19. Encapsulation.
Binding data & methods into one unit (class).
20. Difference between procedural language & OOPs.
Procedural → functions & procedures. OOPs → objects & classes.
21. Polymorphism.
Ability to take many forms. Types: Compile-time (overloading), Runtime (overriding).
22. Object with example.
Instance of class. Example: Student s = new Student();
23. Class example.
Blueprint of objects. Example: class Car { String model; }
24. Constructor.
Special method with same name as class, no return type.
25. Recursion.
Method calling itself until base condition is met.
26. Garbage collector.
Automatically frees memory by destroying unused objects.
27. Advantages of OOP.
Modularity, Reusability, Security, Maintainability, Extensibility.
28. History of Java.
Developed by Sun Microsystems (James Gosling) in 1995.
29. Jagged Array.
Array of arrays with different lengths.
30. Return type of main method.
Always 'void' → public static void main().
31. Instance variable.
Variable declared inside class but outside methods, unique for each object.
32. Method.
Block of code to perform task, may return value.
33. Command line arguments.
Values passed to main method using args[].
34. Difference print() vs println().
print() → same line; println() → moves to new line.
35. Heap area.
Memory area where objects are stored dynamically.
36. Bitwise vs Logical operators.
Bitwise → &, |, ^ (works on bits). Logical → &&, ||, ! (works on conditions).
37. Scope of local variable.
Accessible only within the method/block where declared.