Section B - Short Answer Questions (Detailed)
Q2. Features of Java:
1. Simple, Object-Oriented, Platform-Independent
2. Secure, Robust, Multithreaded, Dynamic
Q3. Types of Inheritance:
- Single, Multilevel, Hierarchical (No multiple via class)
- Use of Interface for multiple inheritance
Q4. Constructors:
- Default: A() { }
- Parameterized: A(int x) { }
- Copy: A(A obj) { }
Q5. Exception Types:
- Checked: IOException
- Unchecked: ArithmeticException
- Error: OutOfMemoryError
Q6. Polymorphism:
- Compile-time: method overloading
- Runtime: method overriding
Q7. Applet Life Cycle:
- init() -> start() -> paint() -> stop() -> destroy()
Section C - Long Answer Questions (Detailed)
Q8. OOP Principles:
- Encapsulation, Inheritance, Polymorphism, Abstraction
- Example: classes, interfaces, method overriding
Q9. Arrays in Java:
- Single Dim: int[] arr = {1,2}
- Multi Dim: int[][] mat = {{1,2},{3,4}}
Q10. Exception Handling:
- try, catch, finally
- Custom Exception class using extends Exception
Q11. AWT Components:
- Label, TextField, Button, Checkbox
- Layout: setBounds(), setLayout(null)
Q12. JDBC Steps:
- Load Driver, Get Connection, Create Statement, Execute Query, Close
Example:
Class.forName("...");
Connection con = DriverManager.getConnection(...);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(...);