NOTICE: This list does not guarantee that your board or internal exam
questions will be included from this list too. This is just a collection of old
questions.
Topic 1: Basics of Programming in Java
1. Explain the Java architecture and significance of class path. Differentiate between
error and exception.
2. Define package. Explain the type of access modifiers in Java.
3. What are the most powerful features of Java? Describe how it is a platform neutral
language by a diagram.
4. Explain the intermediate working principle of Java programming language that
makes it runnable on any platform.
5. Illustrate the scope of static and local variables with an example. Differentiate
between applet and Java application.
6. The final keyword in Java can be applied to fields, parameters, methods and
classes. For each of these four cases, explain what the effect of the final keyword
is.
7. What do you mean by architectural-neutral? What are wrapper classes? Explain.
8. What is the difference between abstract class and interface.
9. Write a Java program to get 10 array elements from the user and put event and odd
elements in a separate array. Explain public static void main(String[] args){}
Topic 2: Object oriented principles in Java
1. Define interface. Write Java program that override methods (getUserValue()) and
(displayUserDetail()), where getUserValue() is defined to get user detail(name,
address, age) and displayUserDetail() to display user detail.
2. Define subclass and superclass. How can we achieve multiple inheritance in Java?
Explain.
3. Differentiate between Java abstract class and interface with a sample program.
4. What is the interface? WAP to show interface implementation in Java.
5. Define inheritance and composition. With the help of a suitable program illustrate
the difference between them.
6. What is method overloading? Can you override a private or static method in
Java?Explain with an example.
Topic 3: Building components using Swing and JavaFX
1. Compare AWT with Swing. Write a GUI program using components to find sum
and difference of two numbers. Use two text fields for giving input and a label for
output. The program should display sum if user presses mouse and difference if
user release mouse.
2. What is JavaFX? Compare it with swing. Explain FlowPane layout of JavaFX.
3. Why do we need event handling? Explain the use of action event with example.
Why do we need adapter class in event handling?
4. Why do we need swing components ? Explain the uses of check boxes and radio
buttons in GUI programming.
5. Compare JavaFX with swing. Explain HBox and BBox layouts of JavaFX.
6. Define event delegation model. What is the task of Layout manager? Describe
about default layout manager.
7. Write a program to create a Frame that has two TextField components, one Label
and a Button. When the user clicks on the button, calculate the sum of the values
entered in the first and second TextField and display the result on the third Label.
8. There are the pros and cons of JavaFX. Explain any two JavaFX layout manager.
Topic 4: Distributed Network Programming
1. Create a TCP client server application where the client sends a string and the
server responds by echoing the same string in upper case.
2. What is JavaMail API? Explain type of protocol used in JavaMail API.
3. Define RMI stubs and skeleton. Create an RMI application where a client can
remotely invoke a method that sends the sum of any two given integers.
4. Create a TCP client/server program in which client sends an integer to the server
and server responds to client by sending square of the number sent by client.
5. What is the significance of stub and skeleton in RMI? Create a RMI application
such that a client sends an integer number to the server and server return the
factorial value of that integer.
6. Short question: CORBA, TCP and UDP socket.
7. Explain the use of URL and URL connection class with a suitable example.
8. Define Java Socket Programming. Write java program to create own client and
server.
9. Why CORBA is important? Compare CORMA with RMI.
10.Explain RMI architecture layers in detail.
Topic 5: Database Connectivity with JAVA
1. A table tbl_student consists of id, name and program. Write a program that asks
users to enter a program name and displays all the students records enrolled in the
program.
2. Short Note: SQL Injection, Types of JDBC driver
3. Briefly describe JDBC-ODBC types of bridge and driver in java.
4. Write a program to display only those records whose salary is more than 25000
from a table that contains id, name, post and salary of some employees.
5. What is JDBC? Draw JDBC architecture and explain JDBC drivers with their
advantages and disadvantages.
6. Write a program(WAP) to insert data of any students with schemas(name, age,
semester, university, status). By default SQL connector is to be used(if
comfortable with any database connector. Free to describe and use accordingly)
7. WAP to connect a java program to database successfully.
8. What are the differences between JDBC and ODBC?
9. A database db_std contains a table tbl_std having field roll, name, faculty and
mark. Write a program that does achieve the following:
a. Print the total number of students
b. Find the average mark
10.What is row set? Explain cached row set in detail.
Topic 6: SERVLETS AND JSP
1. Explain the life cycle of servlet.
2. Create a simple servlet that reads and displays data from HTML form. Assume
form with two fields username and password.
3. What is servlet? Write a simple JSP file to display “Pokhara University” five
times.
4. Differentiate between GET and POST methods. Write java program that depict
Sessions and Cookies.
5. Write a servlet program that accept input string from user through form and then
check if it is palindrome or not.
6. Short Note: Java Server pages
Topic 7: Advanced Topics in Java
1. Why do we need design patterns? Explain Singleton Pattern and Factory Method
Pattern in detail.
2. Short Notes: ORM
3. What is the significance of Web Framework in App development.
4. What is the purpose of Hibernate?
5. Explain the importance of concurrency and multithreading in Java. How
multithreading is performed in Java?