/* 2. Student Class
Create class Student
Add variables: name, rollNumber, grade
Create two different objects with different values
Print all details using System.debug()*/
public class Student {
String name;
Integer rollNumber;
String grade;
}
Student feature = new Student();
feature.name = 'Lokesh Kumar';
feature.rollNumber = 21;
feature.grade = 'B';
System.debug('Name:'+ feature.name);
System.debug('Roll Number:'+ feature.rollNumber);
System.debug('Grade:'+ feature.grade);
/* 3. Book Class
Create class Book
Add variables: title, author, isbn
Create an object and assign values
Print each value with clear labeling (e.g., "Book Title: ...")
🔹 4. Laptop Class
Create class Laptop
Add variables: brand, processor, ramSize
Create three different objects
Print only laptops with more than 8GB RAM
🔹 5. Circle Class (with Calculation)
Create class Circle
Add variable: radius
Add method calculateArea() that returns area (Ï€ * radius^2)
Print area for a circle with radius 7
🔹 6. BankAccount Class
Add variables: accountHolder, accountNumber, balance
Create an object and assign values
Print a statement:
"Account Holder: John | Balance: $5000"
🔹 7. Movie Class
Add variables: name, director, releaseYear
Create 2 movie objects
Print which movie is newer based on release year
🔹 8. Employee Class
Add variables: empName, empId, department
Create an object and print:
"Employee [empId] belongs to [department]"
🔹 9. Temperature Class
Variable: celsius
Add method toFahrenheit() to convert it
Formula: F = (C * 9/5) + 32
Create object with 25°C, print in Fahrenheit
🔹 10. Rectangle Class
Variables: length, width
Add methods: getArea(), getPerimeter()
Print area and perimeter for a 5x10 rectangle
*/