Java Question Bank (2nd Sem)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Java Question Bank

Unit 1

2 marks

1. Define Object Oriented Programming.


2. What is Java?
3. Define Object. Give example
4. What are classes? Give examples.
5. What is Abstraction?
6. What is Encapsulation? How it is implemented in Java?
7. Define Polymorphism.
8. What is Garbage Collection?
9. What is identifier? Give examples.
10. What are keywords? Give example.
11. List the commands used for compilation and execution of Java program.
12. What is JVM?
13. What is Object Oriented programming?
14. Why is Java known as ‘Platform Independent’?
15. What is the use of main() method in Java program?
16. What are the conventions followed in Java for naming an identifier?
17. What are command line arguments? How are they useful?
18. What is a constant? Give example.
19. What is a variable? Give example. Write the syntax to declare and initialize the variable.
20. What is a scope of a variable?
21. What is type casting? Give example.
22. What is an Array. Give syntax to declare and initialize an array.
23. What is the use of ‘instance of’ operator.
24. State the use of ‘static’ keyword.
25. How is an object created in Java? Give syntax and example.
26. What is StringBuffer? How is it different from String?
27. What is the use of ‘this’ keyword?

4 marks

1. Differentiate between Procedural and Object Oriented Programming.


2. Explain features of Java.
3. What is a token? Explain the various types of tokens used in Java.
4. List the data types used in Java. Give example.
5. Explain the use of ‘break’ and ‘continue’ statements with examples.
6. Explain any five methods of String class.
7. Explain various operators used in Java.
8. Write a note on constructor.

9. Describe the structure of a typical Java program.


10. Explain conditional statements in Java with syntax and example.
11. What is looping? Explain various looping statements used in Java with syntax and Example.
12. Explain various Visibility Modifiers(Access Specifiers) in Java.
13. Explain method overloading with example.
14. Write a note on Static members.

Unit 2
2 marks
1. Define Inheritance. List its types.
2. What is ‘Super class’ and ‘Sub Class’?
3. What are the uses of ‘super’ keyword?
4. State the significance of ‘final’ keyword.
5. What is abstract method?
6. What is abstract class?
7. Define Dynamic binding.
8. What is method Overriding?
9. Define interface.
10. How is multiple inheritance implemented in java?
11. Define Package.
12. List built-in packages of Java API.

4 marks
1. Explain Types of Inheritance with block diagram and syntax.
2. Explain Inheritance with program.
3. Explain Multilevel Inheritance with programming example.
4. Demonstrate the use of super keyword with program
5. What are the uses of ‘super’ keyword?
6. Explain method overriding/polymorphism with the program.
7. Demonstrate Multiple Inheritance with program.
8. What are packages. Explain the procedure to create and import user defined packages in java.
9. Explain built-in (API) packages of java.

Unit 3
2 marks
1. Define event.
2. List various types of Events.
3. What is event handling?
4. State the event associated with button click.
5. List the various Key events.
6. List the various Mouse events.
7. Which package is used for GUI programming in Java.
8. Define component. Give example.
9. What is container? Give example.
10. What is Layout Manager?
11. What is FlowLayout?
12. What is GridLayout?
13. What is Frame?
14. What is the use of following GUI component? (each one may be asked for 2 marks)
a. Button
b. TextField
c. Label
d. CheckBox
e. Text Area
f. Radio Button(also called CheckBoxGroup)
g. Choice (Also called ComboBox)
h. ListBox
i. Menu
j. TextArea
15. What is java.awt?
16. What is applet?(May be asked)
17. What is Listener?
18. What is ActionEvent?
4 marks
1. Explain various events related to KeyEvents.
2. Explain various events related to MouseEvents.
3. Explain exception handling mechanism in java.
4. Explain various GUI components (Any 5).
5. Explain various Layouts?
6. (All journal programs related to events and GUI. Each one may be asked for

Unit 4
2 marks
19. Define multithreading.
20. What are the two ways to implement multithreading in Java?
21. What is Thread Priority?
22. Define exception. Give example.
23. List the methods used in thread life cycle.
24. What are checked and unchecked exceptions
25. What is meant by try and catch?
26. What is the use of ‘finally’ keyword?
27. What is Java bean?
28. What is Stream?
29. What is InputStream and OutputStream?
30. What is DataInputStream?
31. What is FileInputStream and FileOutputStream?
32. What is Reader and Writer?
33. What is java.io package?
4 marks
7. Write a note on thread priority.
8. Explain thread life cycle with neat diagram.
9. Explain exception handling mechanism in java.
10. Differentiate between Multithreading and Multitasking.(May be asked)
11. Explain the two ways to implement multithreading in Java.
12. Journal Program on Thread. (Any one)

You might also like