0% found this document useful (0 votes)
7 views11 pages

Java Outputs

The document outlines various Java programming tasks, including creating a simple calculator, developing applets, implementing multithreading, and handling exceptions. It also covers data structures like linked lists, traffic light simulation, and sorting algorithms. Additionally, it includes file handling and inter-thread communication examples.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views11 pages

Java Outputs

The document outlines various Java programming tasks, including creating a simple calculator, developing applets, implementing multithreading, and handling exceptions. It also covers data structures like linked lists, traffic light simulation, and sorting algorithms. Additionally, it includes file handling and inter-thread communication examples.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1)Use Eclipse or Netbean platform and acquaint with the various menus.

Create a test
project, and 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.

Output 1:

Welcome to AVNIET Engineering College

--------Prime Number--------

Enter valid Number

17

17 is Prime Number

Output 2:

Welcome to AVNIET Engineering College

--------Prime Number--------

Enter valid Number

10

10 is not Prime Number

2)Write a Java Program that works as simple calculator .Use grid layout to arrange buttons
for the digits and for the +,-,*,% operations .Add text field to display the results, Handle
any possible exceptions like divide by zero.
3.a) Develop an Applet in java that displays a Simple Message
3.b) Develop an Applet in java that receives an integer in one TextField,and computes its
Factorial value and returns it in another textfield,when button named “Compute” is
clicked.

4)Write a Program that creates User Interface to perform Integer [Link] user enters
two numbers in text fields, Num1 and [Link] division of Num1 and Num2 is displayed
in the result field when the divide button clicked. If Num1 or Num2 were not integer, the
program would throw a NumberFormatException, If Num2 is Zero, and the program would
throw an Athematic Exception. Display the Exception in message box.
5)Write Java Program that implements a multithread application that has three
[Link] thread generates random integer for every second and if the value is
even,second thread computes the square of number and [Link] the value is odd,the
third thread will print the value of cube of number.

[Link] a Java program for the following:

[Link] a doubly linked list of elements.

[Link] a given element from the above list.


[Link] the contents of the list after deletion.
7) Write a Java Program that simulates a Traffic Light. The program lets the use select one
of three lights :red, yellow or Green with [Link] selecting radio button, an
appropriate message with “stop” or “Ready” or “GO” should appear above the button in
selected [Link] ,there is no message shown
8)Write a Java Program to create an abstract class named shape that contains two integers
and an empty method named [Link] three classes named Rectangle,Triangle
and Circle subclass that each one of the classes extends the Class [Link] one of the
classes contains only the method printArea() that prints the area of Shape.
9)Suppose that a table named [Link] is stored in a text file. The First line in the file is the
header, and the remaining lines correspond rows in table. The elements are separated by
commas. Write java program to display the table using Label in Grid Layout.

10)Write a Java Program that handles all mouse events and show event name at the
center of the window when the mouse event is fired.(Use Adapter Classes).
11)Write a java program that loads names and phone numbers from the text file where
data is organized as one line per record and each field in record are separated by a tab(\
t).It takes a name or phone number as input and prints corresponding other value from
hash table(hint: use Hash Table).
12)Write a Java program that correctly implements the producer – consumer problem
using the concept of interthread communication.

13)Write a Java program to list all the files in a directory including the files present in all its
subdirectories.
14)Write a java program that implements QuickSort algorithm for sorting a list of names in
ascending order.

Output:

15)Write a Java program that implements Bubble sort algorithm for sorting in descending
order and also shows the number of interchanges occurred for the given set of integers.

You might also like