Experiment-4- Foundation of OOP- Working with
Class and Objects
Aim of the Experiment-To demonstrate the implementation and practical application of
classes and objects in java.
Experiments-
1. Write a program to count the number of objects created using a class.
2. Write a program that would print the information (name, year of joining, salary,
address) of three employees by creating a class named 'Employee'. The output
should be as follows:
Name Year of joining Address
Ujwal 2024 BBS
Ravi 2023 KUR
3. Write a program to print the area and circumference of a circle by creating a class.
4. Create a class called InvoiceItem, which models an item of an invoice, with ID,
description, quantity and unit price. Add methods for discount applying discount and
taxes as well. In addition, display the invoice generated for the user’s input regarding
the respective details.
5. Demonstrate different ways to initialise instance variables using a constructor.