Java-QUESTION BANK
Java-QUESTION BANK
PART A (2 Marks)
S.No Questions Marks COs
1. What are the features of java? 2 CO1
2. What is the use of ‘this’ keyword? 2 CO1
3. Differentiate final, finally, and finalize in java 2 CO1
4. Why java does not provide any destructor? 2 CO1
5. How is a constant defined in java? 2 CO1
6. What is Java Virtual Machine? 2 CO1
7. How to create one dimensional array in Java 2 CO1
8. What is a Constructor? How it differ from method in java. 2 CO1
9. What is a class? How memory is allocated dynamically to an object of a class? 2 CO1
10. What is an Object? Give example 2 CO1
11. List out the situations in which static methods are used. 2 CO1
12. What is inheritance? What are sub class and super class? 2 CO1
13. What are the different types of inheritance? 2 CO1
14. What is dynamic method dispatch? 2 CO1
Why Java does not provide multiple inheritance?How multiple inheritances can be 2 CO1
15. achieved in java?
16 Specify the use of super () in constructors. 2 CO1
Differentiate between early binding (or) static binding and late binding(or)dynamic 2 CO1
17
binding.
18 What is method overloading and method overriding? 2 CO1
19 What is an Abstract Class? 2 CO1
20 What is String Buffer class and how does it differs from String class?. 2 CO1
21 What is package and how is it used? 2 CO2
1
22 Define interface. Specify its uses. 2 CO2
23 Differentiate classe,abstract class and interface. 2 CO2
24 How will you extend one interface by other interface? 2 CO2
25 Which package is always imported by default? 2 CO2
PART C( 10 Marks)
S.No Questions Marks COs
1. Write java program using classes to perform linear search on an array of N numbers 10 CO1
Write a java program to arrange the given characters in ascending order by getting the 10 CO1
2.
user input
Write a java program to find the area and volume of sphere using the concept of object, 10 CO1
3.
classes, methods and constructors.
Write a java program that implements the concept of method overloading to find the 10 CO1
4.
volume of cube and rectangular prism.
5. Write a java program to implement the concept of call by reference and call by value. 10 CO1
Write a java program that implements the concept of method overriding to find the area 10 CO1
6.
of rectangle and triangle.
Develop a java program to find the area of rectangle, square and circle using interfaces. 10 CO2
7.
Write a Package to perform arithmetic operation. Write a java program to import the 10 CO2
9.
package
2
Test Unit/Portions for INTERNAL EXAM – II
UNIT II - Exception Handling-exception types-uncaught exception-multiple catch-nested try-
throw and finally-built-in exceptions-multithreaded programming-java thread model-thread
priorities-synchronization thread class and runnable interface-creating multiple threads- inter
thread communication-string-input and output
Internal Test 2
UNIT III : INPUT AND OUTPUT STREAMS
I/O basics-reading console input-writing console output-reading and writing files-applet
fundamentals-Applet Basics-An Applet Skeleton-Simple Applet Display Methods-The HTML
APPLET Tag-Passing Parameters to Applets-using instance of-native method
PART A (2 Marks)
S.No Questions Marks COs
What are the different ways to handle exceptions? Is it essential to catch all types of 2 CO2
1.
exceptions?
2. What is the difference between throw and throws? 2 CO2
3. What is a thread? List out the thread states. 2 CO2
4. What is the importance of thread synchronization? 2 CO2
5. What is multithreading? 2 CO2
What are the two ways for creating a thread? Explain the difference in using runnable 2 CO2
6.
and extends in Thread.
7. How does java support inter thread communication? 2 CO2
8. Difference between sleep() and wait() 2 CO2
9. What is an Exception? Differentiate checked and unchecked exception? 2 CO2
10. Differentiate error from exception. How is custom exception created? 2 CO2
11. What is the use of Alive () and Join()method ? 2 CO2
12. How strings are implemented in java? 2 CO2
13. What are the constructors supported for String class? 2 CO2
14. List out some of the special string operations in java. 2 CO2
15. List out some of the character extraction operations in java. 2 CO2
16. List out the constructor supported for String Buffer class. 2 CO2
17. List out the methods of String Buffer class. 2 CO2
18. What is an applet? 2 CO3
19. What is the difference between applications and applets? 2 CO3
20. What is a stream and which class allows your to read objects directly from stream? 2 CO3
21. Difference between init() and start() methods. 2 CO3
22. How to set foreground and background color of the applet? 2 CO3
23. What are the methods that control an applet’s on-screen appearance 2 CO3
24. Explain how to read information from the applet parameters 2 CO3
25. What are the ways in which we can pass the parameter to an applet? 2 CO3
26. List the ways of reading the console input. 2 CO3
27. Write the structure of Applet. 2 CO3
3
28. What is a stream? Draw the hierarchy of stream class. 2 CO3
29. Distinguish between Input stream and reader classes & Output stream and writer classes. 2 CO3
30. Discuss the use of HTML tag in applets with an example 2 CO3
31. What are the attributes of APPLET tag? 2 CO3
32. How can we determine the height and width of the applet? 2 CO3
33. What are the different ways of running an applet? 2 CO3
34. Why the applet classes are declared as public? 2 CO3
35. How will you pass parameters to applet 2 CO3
36. What is Byte stream in Java? 2 CO3
37. What is the use of native methods in Applets? 2 CO3
4
Write a thread synchronization implementation program that displays contents of 10 CO2
4.
text supplied through three threads
Design a program using Thread class and Runnable interfaces of your choice and 10 CO2
5.
compare the differences
Write an applet program that sets the foreground and back ground colours and 10 CO3
6.
outputs a string.
7. Write an example program that demonstrate passing parameters to Applets 10 CO3
8. Write an java program to demonstrate applet skeleton 10 CO3
9. Write an applet program to fill colours in Shapes. 10 CO3
10. Write a program to display image using applets. 10 CO3
PART A (2 Marks)
S.No Questions Marks COs
1. What is an event delegation model? 2 CO4
2. What is the difference between event model and event delegation model? 2 CO4
3. What are the advantages of event driven programming? 2 CO4
4. Mention subclasses of the AWT event class 2 CO4
5. What is an event? What are the methods available to handle events in java? 2 CO4
6. What are the steps for handling events in java? 2 CO4
7. Distinguish between component and container. 2 CO4
PART B( 14 Marks)
S.No Questions Marks COs
1. Describe about event delegation model. 14 CO4
Explain about Action Event, Adjustment Event, component Event and Container 14 CO4
2.
Event classes and its corresponding interfaces.
PART A (2 Marks)
S.No Questions Marks COs
5
1. Write the various types of Listener Classes? 2 CO4
Name Listener methods that must be implemented for Action Listener, 2 CO4
2.
Adjustment Listener, Component Listener and Container Listener
3. What is the difference between event-listener interface and event-adapter class? 2 CO4
4. What are inner class and anonymous class? 2 CO4
5. What interface is extended by AWT event listeners? 2 CO4
6. What is the need for inner classes? Explain with an example 2 CO4
"Java class can be used both as an applet as well as an application" - Support this 2 CO4
7.
statement with an example.
8. With an example explain an adapter class 2 CO4
9. What is the purpose of repaint method? When should we use repaint method? 2 CO4
10. How does a radio button differ from the check box in java? 2 CO4
11. Draw the inheritance hierarchy for frame and component classes in AWT 2 CO5
12. What is the difference between the ‘Font’ and ‘Font Metric’ Class 2 CO5
13. Define AWT? 2 CO5
14. What is Panel? 2 CO5
15. What is a frame? 2 CO5
16. List the method of graphics class 2 CO5
17. Is there any method for drawing circle in graphics class? If not explain 2 CO5
18. Write syntax for drawing a line. 2 CO5
19. Give any methods used for drawing lines. 2 CO5
20. Summarize the fundamentals of windows 2 CO5
21. List out the method of color class 2 CO5
22. What are way to create a frame in AWT component 2 CO5
23. Which method is used to enable or disable the Frame? 2 CO5
24. Write syntax for Rounded Rectangle 2 CO5
25. Differentiate between frame and panel 2 CO5
26. What is the difference between a Window and a Frame? 2 CO5
PART B(14 Marks)
S.No Questions Marks COs
1. Explain the types of inner classes with suitable examples 14 CO4
2. Create an anonymous inner class for handling Action event into an applet. 14 CO4
What is event handling in java? List out available event classes and listener 14 CO4
3.
interfaces and explain with examples.
4. Explain adapter class with suitable example 14 CO4
5. Demonstrate the mouse and Keyboard event handlers with a java program 14 CO4
6. Explain detail about the following terms a) Component b) Container c) Panel d) 14 CO5
7. Window
Enumeratee) the
Frame f )ofCanvas
steps displaying information within a window with examples 14 CO5
8. Explain in detail about color class with relevant example java program 14 CO5
9. Illustrate about creating a frame window in an applet with a sample java program. 14 CO5
10. Explain in detail about font class with relevant example java program 14 CO5
6
11. Describe about working with graphics in detail. 14 CO5
3. Illustrate with a java program that implements Component Listener Interface. 10 CO4
4. Design a java program that implements Container Listener Interface. 10 CO4
5. Write a java program to draw lines and rectangles with coordinates of your choice. 10 CO5
6. Write a java program to draw ellipses and circles with coordinates of your choice. 10 CO5
7. Create a java program for color demonstration applet 10 CO5
8. Develop a java program to show fonts 10 CO5
SIGNATURES :
Name of the course coordinator S.Karthic