Faculty of Engineering & Technology (Coed)
Department of Computer Science & Engineering
Java Questions Bank
Module I
1. Distinguish between Procedure Oriented and Object Oriented Programming.
2. What is OOP? Explain three principles of Object oriented programming.
3. Compare C, C++ and JAVA.
4. Explain console input and output.
5. Implement a C++ program to find area of rectangle (area=base*height),Area of circle
(area=pi*r*r)and area of triangle(area=1/2*base*height) using function overloading concepts. Call
these functions from main with suitable inputs.
6. Define variable? Explain reference variables in C++ with programming example.
7. What is function prototyping? Explain with syntax and example.
8. Define function overloading? Explain with an example.
9. Develop a program to show the working of scope resolution operator.
10. Write a note on scope resolution operator and this pointer.
11. Discuss the declaration and usage of static data member?
12. What is an inline function? What are the advantages of inline function? Give a suitable example.
13. Why friend functions are required? Write a C++ program to illustrate the use of friend function.
Module II
1. List and explain the features of JAVA
2. Explain scope and life time of variables with example.
3. Discuss primitive data types used in JAVA.
4. Explain bit-wise logical operators consider a=3 and b=6 apply bit wise logical operator on their
operands and print suitable results.
5. Explain Boolean logical operators with example.
6. With an example explain ternary operators? Write a program to find biggest among 3 members
using ternary operator.
7. What is type conversion and type casting in java? Write a java program to illustrate type casting
of the data type and type conversion.
8. What are access specifiers? Explain them.
9. Explain the concept of array in java with an example.
10. With syntax and example explain if,if-else and nested if statements.
11. With suitable example explain the jump statements.
12. Explain with an example while and do-while loop.
13. How for each is different from for loop? Develop a program to show the working of for each
loop.
14. What is class? How to declare the object for the class explain with an example.
15. Define constructor? What are the rules to write constructors? Give an example.
16. Discuss the following
1) Default constructor
2) parameterized constructor
17. Explain the following
1) use of this keyword
2) Garbage collection.
Module III
1. Define inheritance? Explain with suitable example.
2. Develop a program to show the use of super keyword.
3. Explain method overriding with an example?
4. Write a program in Java that implements multi-level inheritance.
5. Distinguish between method overloading and method overriding in java with suitable example.
6. What is an exception? Explain the following
i)try
ii)catch
iii)throw
iv)throws
v) finally
7. What is an interface? Explain how to define and implement by taking suitable example.
8. What is package? How to create and import package in java. Explain with an example.
9. Describe the levels of access protection available for packages.
10. Differentiate between class and interface.
11. Explain nested interface with an example.
12. Explain the following with example
a) Creating a multilevel-hierarchy.
b) Variables in interface.
13. What is nested try? Explain with an example.
Module IV
1. What is thread? Explain two ways of creating a Thread in java.
2. Define Synchronization? Explain synchronization method.
3. Write a java program for Producer and Consumer problems in threads.
4. Write a java program that creates threads by extending tread class.
a. First thread display “Good Morning” every 1 sec.
b. Second thread displays “Hello “every 2 seconds.
c. Third display “Welcome” every 3 seconds.
5. Explain with an example inter-thread communication.
6. How to change state of thread. Explain with an example?
7. What is event handling? List out the available event classes and explain it.
8. Briefly explain delegation event model.
9. List and explain event-listener interfaces.
10. Discuss about following using delegation event model.
a) Handling mouse events.
b) Handling keyboard events.
11. Explain the following
a) ActionEvent Class
b) AdjustmentEvent Class
c) ContainerEvent Class
d) InputEvent Class
e) MouseEvent Class
Module V
1. What is an applet? Explain two types of applets.
2. Describe any 5 methods defined by Applet.
3. Explain Paint() and Repaint() methods of an applet.
4. Explain the skeleton of an Applet.
5. Write a simple Applet program to print the message “This is my simple Applet” with suitable
steps to execute an Applet.
6. Discuss the HTML Applet Tag with its syntax.
7. How to pass parameters to Applet? Explain with an example.
8. Explain the concept of getDocumentBase() and getCodeBase() with examples.
9. How do applet different from application? Explain with an example.
10. Define InputStream? Explain the methods defined by InputStream.
11. Define OutputStream? Explain the methods defined by OutputStream.
12. Explain FileInputStream with an example.
13. Explain FileOutputStream with an example.
14. Briefly explain PrintStream.