Ajava QB
Ajava QB
MODULE 1
1. What is a collection framework? Explain the methods defined by collection interface.
(7M)
2. Demostrate ArrayList class collection with example. (6)
3. Explain any four legacy collection of framework. (7M)
4. Explain HashMap and TreeMap classes. (8M)
5. Explain ArrayList class and explain the following methods, binarySearch, copy,
equals, fill. (8)
6. Explain Queue interface with its methods. (4)
7. Explain the methods defined by the interface Collection, List, SortedSet, Queue. (10)
8. How collection be accessed using iterator explain with example. (6)
9. Explain the following classes by constructing a java program. LinkedList, ArrayList,
HashSet, TreeSet (10)
10. What is Legacy classes? Explain the different legacy classes with a java program. (10)
11. What are comparators? Write a comparator program to sort the accounts by last
names. (10M)
MODULE 2
1. What is String in Java? Write a JAVA program that demonstrates any four string
constructors of String class (8)
2. Explain the following StringBuffer methods. Insert, append, replace, substring ,
delete(8)
3. Differentiate equals() and == for string comparison. (4)
4. Explain the StringBuffer class with examples capacity, reverse, charAt, deleteCharAt.
(8)
5. Write a program to remove duplicate characters in a given string and display the
resultant string. (8)
6. How does compareTo() method differs from compareToIgnoreCase(). (4)
7. Difference between String class and StringBuffer Class (4M)
8. Explain how to check the occurance of a substring. (5M)
9. Explain any two character handling methods. (4M)
10. Write a JAVA program to sort the names using bubblesort. (6M)
11. Explain the String Comparison methods with suitable programs. (8M)
12. Explain indexOf() and lastIndexOf() methods with example. (4M)
13. What is toString()? Write a program to override toString() and provide your own
string representation. (8M)
14. Explain special string operations with example. (6M)
15. Write a JAVA program to replace all the matching substring within a given string.
(6M)
16. Explain the following StringBuffer methods with examples:
(i) Insert()
(ii) Append()
(iii) Replace()
(iv) Substring()
(v) Capacity()
(vi) Reverse()
(vii) charAt()
(viii) deleteCharAt()
(ix) ensureCapacity()
(x) trimToSize()
MODULE 3
1. What are differences between Swing and AWT?
4. Demonstrate a simple swing application that creates 2 buttons Alpha and Beta and
displays the text “ Alpha pressed” when alpha button is pressed and “ Beta pressed”
when beta button is pressed.
5. Explain painting in swing, support your answer with the help of a program that draws
an arc and circle.
6. Discuss about each of the following components and support each with a program to
create the component and handle the event:
(i) JLabel
(ii) JButton
(iii) JTextfield
(iv) JToggleButton
(v) CheckBoxes
(vi) JRadioButtons
MODULE 4
Faculty HoD