0% found this document useful (0 votes)
4 views5 pages

Advanced Java Module Wise Questions

The document outlines a series of advanced Java module-wise questions covering topics such as the Java Collection Framework, Strings and StringBuffer, Swing, Servlets and JSP, and JDBC. Each module contains specific questions that require explanations, code examples, and comparisons of various Java concepts and classes. The focus is on understanding core functionalities, design patterns, and practical applications in Java programming.

Uploaded by

pradeep211397
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Advanced Java Module Wise Questions

The document outlines a series of advanced Java module-wise questions covering topics such as the Java Collection Framework, Strings and StringBuffer, Swing, Servlets and JSP, and JDBC. Each module contains specific questions that require explanations, code examples, and comparisons of various Java concepts and classes. The focus is on understanding core functionalities, design patterns, and practical applications in Java programming.

Uploaded by

pradeep211397
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Advanced Java - Module Wise Questions

Module 1 – Java Collection Framework


1. What is the Java Collection Framework? Explain the core interfaces: Collection, List, Set, and
Queue.
2. Define legacy classes. Explain any four legacy classes (Vector, Stack, Hashtable, Enumeration)
with a program.
3. Explain the difference between Comparator and Comparable interfaces. Provide a program to
sort a list in reverse order using a Comparator.
4. Explain how a collection can be accessed and traversed using an Iterator with a code example.
5. Discuss the various methods provided by the Arrays class (sort(), binarySearch(), fill()) and
illustrate with an example.
6. Create a Student class (name, roll number). Develop code to store student objects in an
ArrayList and use an Iterator to display their details.
Module 2 – Strings and StringBuffer
1. Why are Strings immutable in Java? Explain the benefits (security, caching, synchronization).
2. Differentiate between String, StringBuffer, and StringBuilder classes with a focus on performance
and thread safety.
3. Discuss the overloaded constructors of the String class and explain character extraction methods
like charAt(), getChars(), toCharArray().
4. Illustrate the usage of append(), insert(), reverse(), and delete() methods in the StringBuffer
class.
5. Compare the == operator, equals(), and compareTo() methods for String comparison with
examples.
6. Develop a program that applies the Bubble Sort algorithm to sort an array of String objects in
ascending order using compareTo().
Module 3 – Swing
1. Describe the Model-View-Controller (MVC) connection in Swing. Explain how this design pattern
is implemented.
2. Discuss the evolution of Java Swing, its key features (pluggable look and feel, lightweight
components) and how it differs from AWT.
3. Explain the functionality and usage of JLabel, JTextField, JButton, and JCheckBox with an
example program.
4. Explain the event handling mechanism in Swing. Develop a program that uses an ActionListener
to display a message when a button is clicked.
5. Elaborate on the concept of painting in Swing and the role of the paintComponent(Graphics g)
method.
6. Build a program to demonstrate an icon-based button (using ImageIcon). When the button is
pressed, update a label with text.
Module 4 – Servlets and JSP
1. Define a Servlet and explain its lifecycle (init(), service(), destroy()) with a neat diagram and
example.
2. Define JSP. Explain the different types of JSP tags (Directives, Scriptlets, Expressions,
Declarations) with examples.
3. Elaborate on session tracking techniques (Cookies, URL Rewriting, Hidden Form Fields) with a
code example.
4. Develop a Servlet program that demonstrates how to access parameters (form data) from an
HTML page.
5. Describe the core classes and interfaces present in the [Link] (or [Link]) package.
6. Construct a JSP page that accepts a user’s name and age, stores them in session attributes, and
displays a personalized greeting.
Module 5 – JDBC
1. Name and explain the four types of JDBC drivers (Type 1 to Type 4).
2. Explain the steps involved in associating the JDBC-ODBC Bridge (Type 1 Driver) with a
database using the ODBC Data Source Administrator in Windows.
3. Enumerate the standard steps involved in connecting to a database.
4. Compare Statement, PreparedStatement, and CallableStatement. Explain why
PreparedStatement is preferred.
5. Explain the difference between DatabaseMetaData and ResultSetMetaData with their respective
uses.
6. Develop a complete Java program to connect to a database, insert a new record into a table, and
display a confirmation message.

You might also like