OOP Fundamentals
OOP Fundamentals
1: Object-Oriented Programming
Fundamentals
1. Create a class called Book with attributes like title, author, and genre.
Implement methods within the class to set and retrieve these attributes.
Instantiate two objects from the Book class, set their attributes, and
display the information.
2. Define a class named Car with both instance and class attributes.
Provide examples for each. Create objects from the Car class and
demonstrate how to modify both instance and class attributes.
4. Create a class named Student with attributes such as name, age, and
roll_number. Define methods within the class to set and retrieve these
attributes. Instantiate two objects from the class, set their attributes,
and display the information.