Java Model
Java Model
Pachamuthu College Of Arts and Science For Women Pachamuthu College Of Arts and Science For Women
Dharmapuri Dharmapuri.
Model Examination March -2025 Model Examination March -2025
Class : II-BSC (CS) /BCA Duration :3 hrs Class :II-BSC (CS) /BCA Duration :3 hrs
Subject :Java programming Marks : 75 Subject : Java programming Marks : 75
Date : Date :
PART –A PART –A
Choose the correct answer. (15*1=15) Choose the correct answer. (15*1=15)
1.Which of the following data types can hold the largest value in Java? 1.Which of the following data types can hold the largest value in Java?
A) int B) long C) float D) double A) int B) long C) float D) double
2, Which method is used to find the length of a string in Java? 2, Which method is used to find the length of a string in Java?
A) length() B) size() C) getLength() D) len() A) length() B) size() C) getLength() D) len()
3. What is the return type of the main method in Java? 3. What is the return type of the main method in Java?
A) void B) int C) String D) Object A) void B) int C) String D) Object
4. In Java, which keyword is used to refer to the current object of a class? 4. In Java, which keyword is used to refer to the current object of a class?
A) this B) super C) current D) object A) this B) super C) current D) object
5. Which access modifier allows members to be accessed by classes in the 5. Which access modifier allows members to be accessed by classes in the
same package and subclasses? same package and subclasses?
A) public B) private C) protected D) default A) public B) private C) protected D) default
6. Which keyword is used to explicitly throw an exception in Java? 6. Which keyword is used to explicitly throw an exception in Java?
A) throw B) catch C) try D) throws A) throw B) catch C) try D) throws
7. What is the default stream for output to the console in Java? 7. What is the default stream for output to the console in Java?
A) System.out B) System.in C) System.err D) FileOutputStream A) System.out B) System.in C) System.err D) FileOutputStream
8. Which class is used to handle file-based output in Java? 8. Which class is used to handle file-based output in Java?
A) FileReader B) FileWriter C) BufferedReader D) PrintWriter A) FileReader B) FileWriter C) BufferedReader D) PrintWriter
9. Which of the following methods is used to write a byte of data to a file in 9. Which of the following methods is used to write a byte of data to a file in
Java? Java?
A) writeByte() B) write() C) output() D) print() A) writeByte() B) write() C) output() D) print()
10. Which of the following is the root class for all AWT components? 10. Which of the following is the root class for all AWT components?
a) Button b) Component c) Frame d) Label a) Button b) Component c) Frame d) Label
11. Which AWT component is used to create a drop-down list of options? 11. Which AWT component is used to create a drop-down list of options?
a) Choice b) List c) ComboBox d) Menu a) Choice b) List c) ComboBox d) Menu
12. Which method is used to register an ActionListener with a Button? 12. Which method is used to register an ActionListener with a Button?
a) addActionListener() b) setActionListener() c) registerListener() a) addActionListener() b) setActionListener() c) registerListener()
d) attachListener() d) attachListener()
13.Which of the following is a top-level container in Swing? 13.Which of the following is a top-level container in Swing?
A) JButton B) JPanel C) JFrame D) JLabel A) JButton B) JPanel C) JFrame D) JLabel
14. Which of the following Swing components allows only a single 14. Which of the following Swing components allows only a single
selection from a group of choices? selection from a group of choices?
A) JCheckBox B) JComboBox C) JRadioButton A) JCheckBox B) JComboBox C) JRadioButton
D) JToggleButton D) JToggleButton
15. Which of these Swing components is best used for holding multiple 15. Which of these Swing components is best used for holding multiple
buttons in a grid layout? buttons in a grid layout?
A) JPanel B) JScrollPane C) JButton D) JList A) JPanel B) JScrollPane C) JButton D) JList
PART-B PART-B
Answer any two questions out of five . (2*5=10) Answer any two questions out of five . (2*5=10)
16. Describe JVM architecture. 16. Describe JVM architecture.
17.Explain a method overloading n a java. 17.Explain a method overloading n a java.
18. What is deadlock? 18. What is deadlock?
19. Describe font and layout managers.. 19. Describe font and layout managers..
20. Explain the hierarchy of swing components in java. 20. Explain the hierarchy of swing components in java.
PART-C PART-C
Answer either A or B for all the questions. (5*10=50) Answer either A or B for all the questions. (5*10=50)
21. a) Explain operator and its types with example. (or) . 21. a) Explain operator and its types with example. (or)
a) Explain control statement. a) Explain control statement.
22. a) Explain inheritance and its types with example .(or) 22. a) Explain inheritance and its types with example .(or)
b)Explain exception handling b)Explain exception handling
23. a) Explain file handling method with example.(or) 23. a) Explain file handling method with example.(or)
b) what is thread ? Explain a inter thread communication in java. b) what is thread ? Explain a inter thread communication in java.
24. a) Describe mouse event handling and key event handling .(or) 24. a) Describe mouse event handling and key event handling .(or)
b)Explain event handling . b)Explain event handling .
25. a)write a top level containers .(or) 25. a)write a top level containers .(or)
b)Discuss the various types of swing buttons with example. b)Discuss the various types of swing buttons with example.