Java Parctical Question
Java Parctical Question
No Experiment List
Name of student: Roll No: Gems No:
Batch:
Q.1
Implement java program to check given number is prime or not. Take number using
command line arguments.
Implement java to print the area of a rectangle by creating a class named 'Area' having two
methods. First method named as 'setDim' takes length and breadth of rectangle as parameters
and the second method named as 'getArea' returns the area of the rectangle. Length and
breadth of rectangle are entered through keyboard
Write a Java Program to demonstrate the use of static variable, static block and static method.
Create abstract class shape with dim1, dim2 variables and abstract area() method. Class
rectangle and triangle inherits shape class. Calculate area of rectangle and triangle.
Name of student: Roll No: Gems No:
Q.7 Batch:
Create interface shape area() method. Class rectangle and triangle inherits shape class.
Calculate area of rectangle and triangle.
Write a java Program to Add button, text field & text area
Q.15
Name of student: Roll No: Gems No:
Batch:
Q16
Name of student: Roll No: Gems No:
Batch:
Write a Java program to find how many words are started with letter “S” in a text file.
Q18
Name of student: Roll No: Gems No:
Batch:
Write a Java program to create a class called Animal with a method called makeSound().
Create a subclass called Cat that overrides the makeSound() method to bark.
Q19
Name of student: Roll No: Gems No:
Batch:
Write a Java program to create a class known as Person with methods called getFirstName()
and getLastName(). Create a subclass called Employee that adds a new method named
getEmployeeId() and overrides the getLastName() method to include the employee's job title.
Q20
Name of student: Roll No: Gems No:
Batch:
Write a Java program to create an interface Playable with a method play() that takes no
arguments and returns void. Create three classes Football, Volleyball, and Basketball that
implement the Playable interface and override the play() method to play the respective sports.