1.
Write a Java program to create a class called "Person" with a name and
age attribute. Create two instances of the "Person" class, set their
attributes using the constructor, and print their name and age.
2. Write a Java program to create a class called "Rectangle" with width
and height attributes. Calculate the area and perimeter of the rectangle.
3. Write a Java program to create a class called "Circle" with a radius
attribute. You can access and modify this attribute. Calculate the area
and circumference of the circle.
4. Write a Java program to create a class called "Employee" with a name,
job title, and salary attributes, and methods to calculate and update
salary.
5. Write a Java program to create class called "TrafficLight" with attributes
for color and duration, and methods to change the color and check for
red or green.
6. Write a Java program to create a class called "Student" with a name,
grade, and courses attributes, and methods to add and remove
courses.
7. Write a Java program to create a class called "Library" with a collection
of books and methods to add and remove books.
8. Write a Java program to create a class called "Airplane" with a flight
number, destination, and departure time attributes, and methods to
check flight status and delay.
9. Write a Java program to create a class called "Restaurant" with
attributes for menu items, prices, and ratings, and methods to add and
remove items, and to calculate average rating.
10. Write a Java program to create a class with methods to search for
flights and hotels, and to book and cancel reservations.