Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

JAVA QUESTION BANK

Module 1

1. Explain the terms: Polymorphism and Encapsulation


2. Consider a Banking System. Identify three entities in the system which can be represented
using classes and show the relationship between them using UML class diagrams
3. What is the role of Java Virtual Machine?
4. Describe any six features of java language
5. Draw Use case Diagram for online Pizza ordering system
6. Draw the Use Case diagram of online railway ticket reservation system
7. Why are java programs said to be platform independent?
8. Represent the following class diagram as a java class.

9. Write short notes on any two object oriented concepts


10. Why java is caleed pure object oriented language.
11. Write note on java virtual machine
12. Draw use case diagram of movie reservation system
13. Give an outline of the java implementation of the class diagram shown below
14.what are advantages of using UML
15. illustrate the steps involved in java compilation
16. differentiate between class and object

Module 2
1. Explain how objects are passed as function parameters with a suitable example
2. What are parameterized constructors? Is it possible to define a parameterized constructor
for a class without defining a parameter-less constructor?
3. Explain method overloading with the help of an example.
4. Discuss the different access specifiers used in java
5. Explain how inheritance is implemented in Java. What is the use of ‘super’ keyword?
Illustrate its usage with suitable examples
6. What are abstract classes?
7. Write briefly about any four features of Java
8. Differentiate between while and do while iterative statements
9. What are the role of a constructor?
10. Compare private, proctected and public acces modfiers
11. Write a java program to check whether a given number is prime or not
12. Show the use of different types of shift operators in java with the help of suitable
examples
13. Define a class Queue for representing a queue data structure. The class must define a
default constructor, a parameterized constructor and functions for en-queue, de-queue and
display operations. Write a Java program to implement this.
14. What is a constructor? What are its uses?
15. Why is the main method in java qualified as public, static, and void?
16. Is it possible create an object for a class A using, A ob = new A(); if the class contains
only parameterized constructor? Justify.
17. Differentiate between Abstract class and Interface
18. Demonstrate how polymorphism can be implemented using method overriding with
suitable example
19. Summarize the different data types in java
20. Implement the following enities as Java classes with suitable instance variables and
methods
a. Student b. Bank account c. Vehicle
21. Describe control statements in java
22. Expalin the concept of methodoverriding with an example
23. Write java program to check whether the string is palindrome or not. The input is
accepted as command line argument
24. Describe the following statemets in java
1)Switch and for 2). Break and continue
25. Define a java class having overloaded methods to calculate area of rectangle and
circle.
26. Is it possible to create an object for the class A using A ob=new A(); if the class
contains only parameterized constructor? Why?
27. With the help of examples, explain how inheritance is implemented in java
28. Differentiate between abstract classes and interface
29. Demonstrate how polymorphism can be implemented using method overriding with
suitable example.

Module 3
1. What are packages? Explain how packages are created in Java.
2. What are interfaces? How interfaces are used in Java?
3. What are Checked Exceptions? Give an example
4. Discuss about any two stream classes used in Java
5. Draw a table showing the visibility of all access specifiers available in java language with respect to;
same class, same package sub-class, same package non sub-class, different package sub-class,
different package non sub-class
6. Does importing a package makes available all classes, interfaces and subpackages within it? Justify
7. What are the uses of “finally” statement in exception handling?
8. List the sub-classes of Writer and Reader character oriented stream classes
9. Explain the scenario under which the following three exceptions occur, NumberFormatException,
ArithmeticException, and ArrayIndexOutOfBoundsException.
10. What is an exception? Why it needs to be handled?
11. What happens if exceptions anr not handled?
12. Write java code for reading the contents of a file
13. List any six built-in packages in java.
14. Differentiate between try-catch and throws statement
15. Describe the concept of interface in java
16. Summarize the character stream classes with he help of class hierarchy diagram
17. Write note on character stram and byte stream related classes
18. What are the advantages of multithreading in java
19. Explain the scenario under which the following three exceptions occur, NumberFormatException,
ArithmeticException, and ArrayIndexOutOfBoundsException

Module 4

1. What are thread priorities? How can you assign priority values for threads
created in Java?
2. Write a Java program to create two threads: One for displaying all odd numbers
between 1 and 100 and second thread for displaying all even numbers between 1
and 100.
3. Draw the lifecycle of a thread showing the different states and methods invoked.
4. What are the uses of “synchronized” keyword?
5. Explain briefly about the Delegation Event model.
6. List any five event sources and their corresponding generated event typeand
listeners used.
7. Describe the different character extraction methods of String class along with
their syntax.
8. Write a java program to count the occurrence of a particular word within a
sentence using string handling methods.
9. Discuss any four methods used for string processing in Java
10. Show using java code how three threads can be created using Runnable interface.
11. Write short notes on any four methods of string class.
12. What is the difference between using “==” and equals() method when comparing
string type?
13. Expalin the event delegattion model.
14. Identify two event types each generated by a Button, Textfiled, Checkbox, and
Frame
15. Explain different ways of creating threads in java
16. Explain event handling in java
17. List any five event sources and their corresponding event types and listeners

Module 5
1. What are layout managers? Explain any one layout manager with an example
2. Discuss the different steps involved in establishing a JDBC connectivity and query
processing with a suitable example.
3. What are the differences between a Java applet and a Java application?
4. What are the advantages of using Swings?
5. Explain any three graphics related methods along with their syntax.
6. Write the steps for connecting a java program to a database, executing a select query,
and fetching the results with sample code.
7. Summarize the features of swing API
8. List any four containers and component classes of swing API
9. Write a java program using JDBC API to verify the login credentials of a user.
10. How do you establish connection between a java program and database? Explain the steps
with suitable code
11. What are the advantages of using Swings?
12. Explain any three graphics related methods along with their syntax

You might also like