📋OBJECT ORIENTED PROGRAMING
Welcome to the repository of Java programs.
💡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 "Dog" with a name and breed attribute. Create two instances of the "Dog" class, set their attributes using the constructor and modify the attributes using the setter methods and print the updated values.
💡3. Write a Java program to create a class called "Rectangle" with width and height attributes. Calculate the area and perimeter of the rectangle.
💡4. 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.
💡
5. Write a Java program to create a class called "Book" with attributes for title, author, and ISBN, and methods to add and remove books from a collection.
💡
6. 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.
💡
7. 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.
💡
8. Write a Java program to create a class called "Employee" with a name, salary, and hire date attributes, and a method to calculate years of service.
💡
9. Write a Java program to create a class called "Student" with a name, grade, and courses attributes, and methods to add and remove courses.
💡
10. Write a Java program to create a class called "Library" with a collection of books and methods to add and remove books.