0% found this document useful (0 votes)
4 views

Java Programming Questions and Answers Clean

The document outlines predicted questions for a Java Programming exam covering various units including basic syntax, inheritance, exception handling, event handling, network programming, and database interaction. It includes both 2-mark and 4/6-mark questions that require definitions, explanations, programming tasks, and comparisons related to Java concepts. Topics range from Java features and constructors to JDBC connections and GUI components.

Uploaded by

sanadeprajwal94
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)
4 views

Java Programming Questions and Answers Clean

The document outlines predicted questions for a Java Programming exam covering various units including basic syntax, inheritance, exception handling, event handling, network programming, and database interaction. It includes both 2-mark and 4/6-mark questions that require definitions, explanations, programming tasks, and comparisons related to Java concepts. Topics range from Java features and constructors to JDBC connections and GUI components.

Uploaded by

sanadeprajwal94
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
You are on page 1/ 4

Predicted Questions (Java Programming 314317 - Exam 2025)

UNIT 1: Basic Syntactical Constructs in Java

2 Marks

List any four features of Java.

Write syntax of type casting with an example.

Enlist any four compile-time errors.

State the use of finalize() method with syntax.

Define wrapper classes. Give examples.

Write syntax of declaring and initializing an array.

Define symbolic constant and give an example.

4 Marks and 6 Marks

Features of Java. (Any four points)

What is a Constructor? Explain Parameterized Constructor with example.

Write a Java Program to print all Armstrong numbers from 0 to 999.

Describe the features of Java (any 4 features).

Write a Java Program to create a class Employee with data members id, name, and salary. Accept

details of 5 employees and display the employee having the highest salary.

Difference between String and StringBuffer. (Any four points)

Describe any four methods of String class.

Explain this and super keyword usage.

Explain Vector class with 4 methods and examples.

UNIT 2: Inheritance, Interface and Packages

2 Marks

State two advantages of using Inheritance.

Differentiate between method overloading and method overriding. (Any 2 points)

State syntax for creating and importing a package.

Give use of 'super' keyword with one example.


Define Interface with syntax.

List any two types of inheritance in Java.

4 Marks or 6 Marks

Differentiate between Method Overloading and Method Overriding.

Explain Single and Multilevel Inheritance with example.

Define Interface and explain with syntax.

How to create and access user-defined Package?

Explain the use of super keyword with example.

Define the interface Shape with two methods: area() and perimeter(). Create two classes Circle and

Rectangle implementing the interface and write a program to demonstrate polymorphism.

Explain Packages with example. How to create and import?

Describe Packages in Java. Explain how to create and import a package with example.

UNIT 3: Exception Handling and Multithreading

2 Marks

Differentiate between Error and Exception.

List any two built-in exceptions in Java.

Write syntax to create a thread by implementing Runnable interface.

State any two thread methods with syntax.

List thread priority constants.

4 Marks or 6 Marks

Program to create a user-defined Exception (example: NoMatchException or MIN_BAL Exception).

Write a program to print even and odd numbers using two threads.

Explain the Life Cycle of a Thread with neat diagram.

Write a Java Program using two Threads:

Thread A prints even numbers from 1 to 50.

Thread B prints odd numbers from 1 to 50.

After 3 numbers, Thread A should sleep for 500 ms.


Write a Java Program to create a user-defined exception named InvalidPasswordException that is

thrown when the password entered is not "MSBTE2025".

Explain the concept of Exception Handling with syntax of try-catch-finally blocks. Provide a suitable

example.

Define exception called 'No Match Exception' that is thrown when the password accepted is not

equal to 'MSBTE'. Write the program.

UNIT 4: Event Handling, AWT & Swing

2 Marks

Enlist any two layout managers.

State two differences between AWT and Swing.

Give syntax of using ActionListener interface.

Write syntax to add a button using AWT.

4 Marks or 6 Marks

Write an applet to take inputs from TextFields and perform an action.

Create a GUI with JTabbedPane with multiple tabs.

Write a program to create JTree with nodes and sub-nodes.

Explain JScrollPane and JTable with constructors.

UNIT 5: Basics of Network Programming

2 Marks

State any two methods of InetAddress class.

Define reserved socket with example.

State the use of URLConnection class.

List any two factory methods of URL class.

4 Marks or 6 Marks

Explain InetAddress with example.

Write server-client steps of program using TCP sockets.

Difference between TCP and UDP


Explain use of URLConnection class with program.

List and explain URL class methods.

UNIT 6: Interacting with Database (JDBC)

2 Marks

State any two JDBC driver types.

Write steps to establish a JDBC connection. (List form)

Differentiate between two-tier and three-tier architecture (any 2 points).

Give syntax for creating Statement and ResultSet.

4 Marks or 6 Marks

Write a JDBC program to connect and perform Insert/Delete/Update.

Explain PreparedStatement interface with program.

You might also like