githubEdit

CSE423 / Java Lab

Syllabus

Faculty Resources

[⤓] Lab 1arrow-up-right

[⤓] Lab 2arrow-up-right

[⤓] Lab 3arrow-up-right

[⤓] Lab 4arrow-up-right

[⤓] Lab 5arrow-up-right

[⤓] Lab 6arrow-up-right

Experiments

chevron-rightEXPT1: Test Projecthashtag

Use Eclipse or NetBeans platform and acquaint with the various menus. Create a test project, add a test class and run it. See how you can use auto suggestions, auto fill. Try code formatter and code refactoring like renaming variables, methods and classes. Try debug step by step with a small program of about 10 to 15 lines which contains at least one if else condition and a for loop.

// Some code
chevron-rightEXPT2: Calculatorhashtag

Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons for the digits and for the +, -, *, % operations. Add a text field to display the result. Handle any possible exceptions like divided by zero.

chevron-rightEXPT3: Message Displayhashtag

Develop an applet in Java that displays a simple message.

chevron-rightEXPT4: Factorial Calculatorhashtag

Develop an applet in Java that receives an integer in one text field, and computes its factorial Value and returns it in another text field, when the button named "Compute" is clicked.

chevron-rightEXPT5: Integer Division UIhashtag

Write a Java program that creates a user interface to perform integer divisions. The user enters two numbers in the text fields, Num1 andNum2. The division of Num1 and Num2 is displayed in the Result field when the Divide button is clicked. If Num1 or Num2 were not an integer, the program would throw a Number Format Exception. If Num2 were Zero, the program would throw an Arithmetic Exception. Display the exception in a message dialog box.

chevron-rightEXPT6: Multi Thread Applicationhashtag

Write a Java program that implements a multi-thread application that has three threads. First thread generates random integer every 1 second and if the value is even, second thread computes the square of the number and prints. If the value is odd, the third thread will print the value of cube of the number.

chevron-rightEXPT7: Database Connectionhashtag

Write a Java program that connects to a database using JDBC and does add, delete, modify and retrieve operations

chevron-rightEXPT8: Traffic Light Simulator Logichashtag

Write a Java program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green with radio buttons. On selecting a button, an appropriate message with "Stop" or "Ready" or "Go" should appear above the buttons in selected color. Initially there is no message shown.

chevron-rightEXPT9: Abstract Classhashtag

Write a Java program to create an abstract class named Shape that contains two integers and an empty method named printArea(). Provide three classes named Rectangle, Triangle and Circle such that each one of the classes extends the class Shape. Each one of the classes contains only the method printArea() that prints the area of the given shape.

chevron-rightEXPT10: Tables Display as Labels in Grid Layouthashtag

Suppose that a table named Table.txt is stored in a text file. The first line in the file is the header, and the remaining lines correspond to rows in the table. The elements are separated by commas. Write a java program to display the table using Labels in Grid Layout.

chevron-rightEXPT11: Adapter Classeshashtag

Write a Java program that handles all mouse events and shows the event name at the center of the window when a mouse event is fired (Use Adapter classes).

chevron-rightEXPT12: Hash Table, TSV Text Datahashtag

Write a Java program that loads names and phone numbers from a text file where the data is organized as one line per record and each field in a record are separated by a tab. It takes a name or phone number as input and prints the corresponding other value from the hash table (hint: use hash tables).

chevron-rightEXPT13: Hash Table, Database Datahashtag

Write a Java program that loads names and phone numbers from a database where the data is organized as one row per record and each field in a record are separate. It takes a name or phone number as input and prints the corresponding other value from the hash table (hint: use hash tables).

chevron-rightEXPT14: TSV in Databasehashtag

Write a Java program that takes tab separated data (one record per line) from a text file and inserts them into a database.

chevron-rightEXPT15: Table Meta Datahashtag

Write a java program that prints the meta-data of a given table.

Get Credited for sharing your Knowledge Source with your Peers
Submit Queries/Feedbacks/Suggestions/Complaints using this Form

Last updated