0% found this document useful (0 votes)
2 views2 pages

Java Programming Solved Questions

The document outlines various Java programming concepts and solved questions, including the compilation and execution process, matrix addition, inheritance types, abstract classes, runtime polymorphism, and multithreading. It also covers GUI programming with Swing and AWT, event handling, and access protection levels in Java. Each section provides a brief description of the topic or a specific program example.

Uploaded by

bitturanjanvlogs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Java Programming Solved Questions

The document outlines various Java programming concepts and solved questions, including the compilation and execution process, matrix addition, inheritance types, abstract classes, runtime polymorphism, and multithreading. It also covers GUI programming with Swing and AWT, event handling, and access protection levels in Java. Each section provides a brief description of the topic or a specific program example.

Uploaded by

bitturanjanvlogs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java Programming – Solved Questions

1. Process of Compiling and Executing a Java Program

Java follows two steps: Compilation and Execution. The source code (.java) is compiled using javac
into bytecode (.class).

The JVM executes bytecode and converts it into machine code, ensuring platform independence.

2. Matrix Addition Using 2D Array

Program demonstrates reading two matrices, adding corresponding elements, and displaying the
result.

3. Inheritance and Its Types

Inheritance allows a class to acquire properties of another class using extends keyword.

Types: Single, Multilevel, Hierarchical, Multiple (using interfaces).

4. Abstract Class Example

Abstract classes contain abstract methods that must be implemented by subclasses.

5. Runtime Polymorphism (RBI Example)

Method overriding allows different implementations of getInterestRate() at runtime.

6. Quadratic Equation Program

Uses quadratic formula to find real roots based on discriminant value.

7. Traffic Light Simulation (Swing)

Uses JRadioButtons and ActionListener to simulate traffic signals.

8. Multithreading – Odd and Even Numbers

Two threads print odd and even numbers from 1 to 20 concurrently.

9. Swing Program to Add Two Numbers

Reads input from two text fields and displays sum in third field.

10. Abstract Window Toolkit (AWT) & Event Handling


AWT provides GUI components. Event handling uses Delegation Event Model with listeners.

11. Program to Find C(n, r) Using Inheritance

Factorial class is inherited to compute combinations.

12. Access Protection Levels in Java

Access specifiers: private, default, protected, public – control visibility and security.

13. Event Handling & Delegation Event Model

Handles user interactions using event source, event object, and listener.

--- End of Solved Paper ---

You might also like