JNTUH B.Tech 2nd year Java Programming Lab gives you detail Java Programming Lab Engineering R13 year subject. It will be help full you to understand you complete curriculum of the year.
Objectives
To introduce java compiler and eclipse platform. To impart hand on experience with java programming
Note
- Use Linux and MySQL for the Lab Experiments. Though not mandatory, encourage the use of Eclipse platform
- The list suggests the minimum program set. Hence, the concerned staff is requested to add more problems to the list as needed
- Use Eclipse or Netbean 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 for matter 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.
- 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
- a) Develop an applet in Java that displays a simple message.
b) 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. - Write a Java program that creates a user interface to perform integer divisions. The user enters two numbers in the text fields, Num1 and Num2. 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.
- 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.
- Write a Java program that connects to a database using JDBC and does add, delete, modify and retrieve operations.
- 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.
TEXT BOOK
- Java Fundamentals – A comprehensive Introduction, Herbert Schildt and Dale Skrien, TMH.
REFERENCE BOOKS
- Java for Programmers, P.J.Deitel and H.M.Deitel, Pearson education (OR) Java: How to Program P.J.Deitel and H.M.Deitel, PHI.
- Object Oriented Programming through Java, P.Radha Krishna, Universities Press.
- Thinking in Java, Bruce Eckel, Pearson Education
- Programming in Java, S.Malhotra and S.Choudhary, Oxford Univ. Press.
Outcomes
The student is expected to have hands on experience with the following:
- Basics of java programming, multi-threaded programs and Exception handling
- The skills to apply OOP in Java programming in problem solving
- Ability to access data from a DB with Java programs
- Use of GUI components (Console and GUI based)
For more information about all JNTU updates please stay connected to us on FB and don’t hesitate to ask any questions in the comment.