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

java adva

The document outlines various questions and programming tasks related to AWT, Swing, network programming, and JDBC in Java. It includes 2-mark, 4-mark, and 6-mark questions that cover definitions, comparisons, and practical coding exercises. The content is structured into units focusing on event handling, network programming, and database interaction.

Uploaded by

kishor
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

java adva

The document outlines various questions and programming tasks related to AWT, Swing, network programming, and JDBC in Java. It includes 2-mark, 4-mark, and 6-mark questions that cover definitions, comparisons, and practical coding exercises. The content is structured into units focusing on event handling, network programming, and database interaction.

Uploaded by

kishor
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
You are on page 1/ 5

🟦 Unit IV: Event Handling using AWT & Swing

Components
🔹 2-Mark Questions

1. Define AWT.

2. Name any two AWT controls.

3. What is the use of TextField and TextArea in AWT?

4. List two differences between AWT and Swing.

5. What is the function of FlowLayout manager?

6. Write two features of Swing.

7. What is the role of ActionListener interface?

8. Define Event Source in delegation model.

9. What are tool tips?

10. Name any two event classes in Java.

🔹 4-Mark Questions

1. Explain the role of Checkbox and CheckboxGroup with example.

2. Describe GridLayout and BorderLayout with diagrams.

3. Compare AWT and Swing (any four points).

4. Explain JComboBox and JRadioButton in Swing.

5. Describe the delegation event model with a neat diagram.

6. Write a program to demonstrate MouseListener.

7. Explain the use of JTabbedPane and JScrollPane.

8. Describe the role of ActionEvent and ItemEvent.

9. What is KeyListener? Explain with example.

10. Explain how TextEvent and TextListener work.

🔹 6-Mark Questions

1. Design a GUI using AWT that has labels, textfields and a submit button. Write event
handling code.

2. Write a program using Swing that shows a login form and displays success/failure on
button click.

3. Create a program using JTable and JProgressBar. Explain each step.

4. Compare all layout managers used in AWT with examples.

5. Explain various Event classes and Listener interfaces in Java.


🟦 Unit V: Basics of Network Programming
🔹 2-Mark Questions

1. Define Socket.

2. What is a Proxy Server?

3. What is InetAddress?

4. What is a reserved socket?

5. Write any two methods of InetAddress.

6. What is the use of DatagramPacket?

7. Define URL.

8. What is a client-server model?

9. What is TCP/IP?

10. What is the purpose of URLConnection class?

🔹 4-Mark Questions

1. Explain the purpose of InetAddress with method examples.

2. Describe TCP/IP client-server model with diagram.

3. Differentiate between TCP socket and Datagram socket.

4. Explain the use of URL and URLConnection classes in networking.

5. Write a short note on Java networking classes and interfaces.

6. Explain how datagram packets are sent and received in Java.

7. Describe the working of client-server socket programming in Java.

8. Write a code to get IP address of a domain using InetAddress.

🔹 6-Mark Questions

1. Write a Java program to implement TCP client-server communication.

2. Write and explain a program to demonstrate use of DatagramSocket and


DatagramPacket.

3. Explain all steps and classes used for network communication using Java.

4. Describe URL and URLConnection classes in detail with a program.

5. Differentiate between reserved sockets, proxy servers and client-server architecture.


🟦 Unit VI: Interacting with Database
🔹 2-Mark Questions

1. What is JDBC?

2. List any two types of JDBC drivers.

3. What is ODBC?

4. Write the role of DriverManager class.

5. What is the use of ResultSet interface?

6. Define PreparedStatement.

7. List two methods of Connection interface.

8. Define two-tier architecture.

9. What is Statement interface?

10. Name any two interfaces used in JDBC.

🔹 4-Mark Questions

1. Explain two-tier and three-tier JDBC architecture.

2. Describe the types of JDBC drivers.

3. Write steps to connect Java with database using JDBC.

4. Compare Statement and PreparedStatement.

5. Describe the use of DriverManager, Connection, and Statement classes.

6. Explain how data can be retrieved using ResultSet.

7. Write a program to insert a record into database using JDBC.

8. What are advantages of PreparedStatement over Statement?

🔹 6-Mark Questions

1. Write a Java program using JDBC to insert, update and delete records from a database.

2. Explain complete JDBC architecture with diagram and describe all involved
classes/interfaces.

3. Describe types of JDBC drivers in detail with diagrams.

4. Write a JDBC program to connect to a MySQL database and display all student records.

5. Explain steps of JDBC connection and role of each interface involved

✅ Unit IV – AWT & Swing + Event Handling

🔹 2-Mark Questions
1. Write a snippet to create a simple AWT Button.

2. How do you set a FlowLayout in a Java Frame?

3. Write a code snippet to handle a Button click using ActionListener.

4. Declare and initialize a JLabel and a JTextField.

🔹 4-Mark Questions

1. Write a Java program using AWT to create a window with 2 labels and 2 text fields.

2. Create a Swing form with JComboBox and JButton. Add sample values to the combo box.

3. Demonstrate GridLayout with 6 buttons using AWT.

4. Write code to implement ItemListener for a group of checkboxes.

🔹 6-Mark Questions

1. Write a complete Java Swing application with JTextField, JButton, and JLabel. On clicking
the button, display text from the field into the label.

2. Develop a program using AWT to create a registration form with name, gender (radio),
and branch (dropdown) inputs.

3. Write a Java Swing application using JTabbedPane having two tabs: Login and Register.

4. Create an AWT program that handles mouse events and displays coordinates in a label.

✅ Unit V – Network Programming

🔹 2-Mark Questions

1. Write a code snippet to create a Socket in Java.

2. Show how to use InetAddress.getLocalHost() and print IP.

3. Write a simple example of a URL connection in Java.

🔹 4-Mark Questions

1. Write a Java program to get and display the IP address of any website.

2. Create a TCP Client-Server communication program to send and receive a message.

3. Write a Java class to send a UDP packet using DatagramPacket.

🔹 6-Mark Questions

1. Develop a Java TCP-based chat application (client and server).

2. Create a Java program to fetch contents of a webpage using URL and URLConnection.
3. Write a program to send and receive data using DatagramSocket (UDP communication).

✅ Unit VI – JDBC (Database Interaction)

🔹 2-Mark Questions

1. Write a code snippet to load JDBC driver.

2. How do you create a Connection object in JDBC?

3. Write a query using PreparedStatement to update student record.

🔹 4-Mark Questions

1. Write a Java JDBC program to insert a record into a students table.

2. Show the usage of ResultSet to display all rows of a table.

3. Demonstrate JDBC connection with MySQL and list all student names.

🔹 6-Mark Questions

1. Write a complete JDBC program to insert, update, delete, and display records from a
student table using PreparedStatement.

2. Create a GUI form in Swing for student registration and store form data into MySQL using
JDBC.

3. Develop a mini project combining Swing and JDBC to perform CRUD operations on a
database table.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy