Unit-wise questions - Advanced Java Programming

Syllabus Notes Old Questions & solutions Yearly Questions Text & reference books
50 questions

1. What is multithreading? How can you write multithreaded programs in java? Discuss with suitable example.

show solution

asked in 2073

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+8)

asked in 2078

1. Define inheritance. Discuss the benefits of using inheritance. Discuss multiple inheritance with suitable example.(1+2+7)

show solution

asked in 2074

1. What is exception handling? Discuss exception handling in detail with suitable example.

show solution

asked in 2072

1. What is exception handling? Discuss the use of each keyword (try, catch, throw, throws and finally) with suitable Java program.

show solution

asked in 2076

1. What is multithreading? Why is it important to develop in computer programs? Discuss life cycle of thread in detail.

show solution

asked in 2071

1. What is interface? How can you use the concept of interface to achieve multiple inheritance? Discuss with suitable example.

show solution

asked in 2070

1. What are exceptions? Why is it important to handle exceptions? Discuss different keywords that are used to handle exception. (2+2+6)

show solution

asked in 2069

2. Explain life-cycle of servlet in detail.Create a simple servlet that reads and displaysdata from HTML form. Assume form with two fields username and password.(5+5)

asked in 2078

2. Why do we need to handle the exception? Distinguish error and exception, Write a program to demonstrate your own exception class. [1+2+7]

show solution

asked in 2075

3. Explain RMI architecture layers in detail. Write a Java programs using RMI to find product of two numbers.(4+6)

asked in 2078

3. Describe the responsibility of Serializable interface. Write a program to read an input string from the user and write the vowels of that string in VOWEL.TXT and consonants in CONSOLNANT.TXT (2+8)

asked in 2077

4. Write an object oriented program to find the area and perimeter of rectangle. 

show solution

asked in 2073

4. Write an object oriented program in Java to find the area of circle.

show solution

asked in 2072

4.Write an object oriented program to find area and perimeter of rectangle. (5)

show solution

asked in 2074

4. How do you achieve multiple inheritance in java? Discuss.

show solution

asked in 2071

4. Discuss the use of interfaces to achieve multiple inheritance. (5)

show solution

asked in 2069

5. Write the simple java program that reads data from one file and writes data to another file.

show solution

asked in 2073

4. What is package? How can you create your own package in Java? Explain with example.(1+4)

asked in 2078

5. Write a simple java program that reads data from one file and writes data to another file.

show solution

asked in 2072

5. Write a simple java program that reads data from one file and writes the data to another file (5)

show solution

asked in 2074

4. Define class. How do you create a class in Java? Differentiate class with interface.

show solution

asked in 2076

5. Discuss the use of multithreading with suitable example. (5)

show solution

asked in 2069

4. An array is called balanced if it's even numbered elements (a[0], a[2], etc.) are even and its odd numbered elements (a[1], a[3],etc.) are Odd. Write a function named is Balanced that accepts an array of integers and returns 1 if the array is balanced otherwise it returns 0. [5]

show solution

asked in 2075

5. Why do we need swing components ? Explain the uses of check boxes and radio buttons in GUI programming. (2+3)

asked in 2078

5. Write a simple Java program that reads a file named "Test.txt" and displays its contents.

show solution

asked in 2076

4. A non-empty array A of length n is called on array of all possibilities if it contains all numbers between 0 and A.length-1 inclusive. Write a method named isAllPossibilities that accepts an integer array and returns 1 if the array is an array of all possiblities, otherwise it returns 0. (15)

show solution

asked in 2077

6. Explain the importance of exception handling with suitable example.

show solution

asked in 2071

6. Write a simple java program to read from and write to files.

show solution

asked in 2070

6. How can we use listener interface to handle events? Compare listener interface with adapter class. (3+2)

asked in 2078

8. Discuss any five classes to handle files in java. (5)

asked in 2069

6. Define the chain of constructor. What is the purpose of private constructor? [5]

show solution

asked in 2075

7. What is row set? Explain cached row set in detail.(1+4)

asked in 2078

8. Write a simple java program to read from and write to files.

show solution

asked in 2071

8. What is Java Mail API ? How can you use this API to send email messages? (1+4)

asked in 2078

7. When does the finally block is mandatory in while handling exception? Describe with a suitable scenario. (5)

show solution

asked in 2077

9. Why multithreading is important in programming? Discuss.

show solution

asked in 2070

9. Compare JavaFX with swing. Explain HBox and BBox layouts of JavaFX.(2+3)

asked in 2078

10. Discuss any 5 exception classes in java.

show solution

asked in 2070

9. Write down the life cycle of thread. Write a program to execute multiple threads in priority base. [2+3]

show solution

asked in 2075

10. What is servlet? Write a simple JSP file to display "Tribhuwan University" five times. (2+3)

asked in 2078

10. When do we use final method and final class? Differentiate between function overloading and function overriding.[2+3]

asked in 2075

11. Why CORBA is important? Compare CORBA with RMI. (3+2)

asked in 2078

10. Why multiple inheritance is not allowed in Java using classes? Give an example.(5)

show solution

asked in 2077

13. Write short notes on: (2.5+2.5)

     a) Multithreading

     b) JSP

asked in 2074

12. Write short notes on: (2*2.5 = 5)

a. JDBC drivers

b. Java server pages

asked in 2078

13. Write short note on: 

      a. Interface

      b. Servlet

asked in 2073

13. Write short note on:

            a. Multithreading

            b. RMI architecture

asked in 2072

12. Why synchronization in essential in multithreading? Describe. (5) 

show solution

asked in 2077

13. Write short notes on.[2.5+2.5]

a. JAVA beans and JAR file

b. MVC design pattern

show solution

asked in 2077

18 questions

1. Design a GUI form using swing with a text field, a text label for displaying the input message “Input any String”, and three buttons with caption CheckPalindrome, Reverse, FindVowels. Write a complete program for above scenario and for checking palindrome in first button, reverse it after clicking second button and extract the vowels from it after clicking third button. (10)

show solution

asked in 2075

2. What is layout management? Discuss any three layout management classes with example of each.

show solution

asked in 2072

2. Write a Java program to find the sum of two numbers using swing components. Use text fields for input and output. Your program displays output if you press any key in keyboard. Use key adapter to handle  events.

show solution

asked in 2076

2. Write a program using swing components to find simple interest. Use text fields for inputs and output. Your program should display the result when the user presses a button.

show solution

asked in 2071

2. Write a program using swing components to multiply two numbers. Use text fields for inputs and output. Your program should display the result when the user press a button.

show solution

asked in 2070

2. Write a program using swing components to add two numbers. Use text fields for inputs and output. Your program should display the result when the user presses a button. (10)

show solution

asked in 2069

3. Write a program using swing components to find simple interest. Use text fields for inputs and output. Your program should display output if the user clicks a button. (10)

show solution

asked in 2074

2. You are hired by a reputed software company which is going to design an application for "Movie Rental System". Your responsibility is to design a schema named MRS and create a table named Movie(id, Tille, Genre, Language, Length). Write a program to design a GUI form to take input for this table and insert the data into table after clicking the OK button (10)

asked in 2077

6.Discuss grid layout with example. 

show solution

asked in 2074

6. Discuss border layout with example. 

show solution

asked in 2073

6. What are the benefits of using swing components? Explain.

show solution

asked in 2072

7. Discuss grid layout with suitable example. (5)

show solution

asked in 2069

6. Why do we need layout management? What is GridBag layout?

show solution

asked in 2076

7. Discuss group layout with suitable example.

show solution

asked in 2071

7. Discuss MVC design pattern with example.

show solution

asked in 2076

6. What is the task of Layout manager? Describe about default layout manager. (1 +4)

show solution

asked in 2077

8. Discuss border layout with suitable example.

show solution

asked in 2070

13. Write short notes on:[2.5+2.5]

a. Grid Layout

b. Ragged Array

show solution

asked in 2075

8 questions

2. why do we need event handling? Discuss the process of handling events with example. Differentiate event listener interface with adapter class. (3+4+3)

show solution

asked in 2074

7. What is action event? Discuss (5)

show solution

asked in 2074

7. Why is it important to handle events? List any five event classes. 

asked in 2073

7. Discuss any three event classes in Java.

asked in 2072

5. Define event delegation model. Why do we need adapter class in event handling? (2+3)

asked in 2077

10. Discuss any five event classes in java.

asked in 2071

11. How can you handle events using adapter classes? Discuss. (5)

asked in 2069

11. Discuss the role of event listeners to handle events with suitable example.

asked in 2070

9 questions

3. Write a Java program using JDBC to extract name of those students who live in Kathmandu district, assuming that the student table has four attributes (ID, name, district, and age).

show solution

asked in 2072

4. What is JDBC? How do you execute SQL queries in JDBC?

show solution

asked in 2070

5. What is JDBC? Discuss different driver types of JDBC.

show solution

asked in 2071

6. What is JDBC? How do you execute SQL statements in JDBC? (2+3)

show solution

asked in 2069

8. How do you execute SQL statement in JDBC? (5)

show solution

asked in 2074

8. What is JDBC? How do you execute SQL statements in JDBC?

show solution

asked in 2073

8. Discuss different driver types on JDBC.

show solution

asked in 2072

8. What are the benefits of using JDBC? What is prepared statement?

show solution

asked in 2076

8. How prepared statements are different with statement? List the types of JDBC driver.[2+3]

show solution

asked in 2075

10 questions

3. What is socket? How can you write java programs that communicate with each other using TCP sockets? Discuss with suitable example.

show solution

asked in 2073

9 What is socket? How can you write java programs that communicate with each other using TCP sockets? (1+4)

show solution

asked in 2074

9. Discuss the process of sending email messages using Java.

show solution

asked in 2073

9. What is socket? Differentiate TCP socket from UDP socket.

show solution

asked in 2072

9. What is TCP socket? Differentiate it with UDP socket.

show solution

asked in 2071

10. What is UDP socket? Differentiate it with TCP socket. (2+3)

show solution

asked in 2069

9. Write Java programs using TCP sockets that communicate with each other in a computer network.

show solution

asked in 2076

11. What is InetAddress class? Discuss.

show solution

asked in 2073

12. What is socket? How can you communicate two programs in a network using TCP Socket?

show solution

asked in 2070

12. What is a socket? Write client and server programs in which a server program accepts a radius of a circle from the client program. Computes area, sends the computed area to the client program, and displays it by client program.[1+4]

show solution

asked in 2075

9 questions

2. What is Java Beans? How is it different from other Java classes? Discuss property design patterns with suitable example of each.

asked in 2073

3. What is java beans? Differentiate it with java class. Discuss bean writing process with suitable examples. (2+2+6)

asked in 2069

5. What is java beans? How is it different from java class?

asked in 2070

11. Discuss property design patterns for Java Beans. (5)

asked in 2074

11. What is Java Bean? How is it different from other Java classes?

asked in 2072

10. Define Java Bean. How is it different from other Java programs? What is design pattern?

asked in 2076

9. What is the task of manifest file? Write the procedure to create it. [2 + 3]

asked in 2077

11. What is java beans? Differentiate it with java classes.

asked in 2071

11. Give any two differences between class and bean. Write the steps to create JAR files. [2+3]

asked in 2075

16 questions

3. Define servlet. Discuss life cycle of servlet. Differentiate servlet with JSP. Write a simple JSP file to display 'IOST' 20 times.

show solution

asked in 2076

3. What is servlet? Differentiate it with JSP. Discuss life cycle of servlet in detail.

show solution

asked in 2071

3. Describe the process to deploy the servlet. Write a program to a JSP web form to take input of a student and submit it to second JSP file which may simply print the values of form submission. [4+6]

show solution

asked in 2075

5. Explain the significance of cookies and sessions with suitable example? [5]

asked in 2075

7. Discuss different methods used in life cycle of servlet.

show solution

asked in 2070

9. What is JSP? Differentiate it with servlet. (2+3)

show solution

asked in 2069

10. Write a Java program using servlet to display "Tribhuvan University". (5)

show solution

asked in 2074

10. What is JSP? Discuss with suitable example.

show solution

asked in 2073

10. What is servlet? Discuss its life cycle.

show solution

asked in 2072

8. Explain the life cycle of a servlet. (5)

show solution

asked in 2077

11. How do you handle HTTP request (GET) using servlet?

show solution

asked in 2076

13. Write a simple JSP program to display “Kathmandu, Nepal” 10 times. (5)

show solution

asked in 2069

11. How forms can be created and processed using JSP? Make it clear with your own assumptions. [5]

asked in 2077

13. Write a simple JSP program to display “Tribhuvan University” 10 times.

show solution

asked in 2071

13. Write a simple JSP program to display “Lalitpur, Nepal” 10 times.

show solution

asked in 2070

13. Write short notes on:

  • Servlet API
  • RMI vs CORBA
show solution

asked in 2076

9 questions

1, 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 the server return the factorial value of that integer. Give a clear specification for every step. (10)

asked in 2077

3. What is RMI? How can you use RMI to develop a program that runs in different machine? Discuss with suitable example.

show solution

asked in 2070

7. Describe the process to run the RMI application. [5]

show solution

asked in 2075

12. What is RMI? Discuss architecture of RMI in detail. (1+4)

show solution

asked in 2069

12. What is CORBA? How is it different from RMI? (2+3)

show solution

asked in 2074

12. What is RMI? Discuss architecture of RMI.

show solution

asked in 2073

12. What is RMI? How is it different from CORBA?

show solution

asked in 2072

12. What is RMI? Differentiate it with CORBA?

show solution

asked in 2071

12. What are different layers of RMI architecture? Explain.

show solution

asked in 2076

questions