0% found this document useful (0 votes)
2 views1 page

Java Experiment 4

The document outlines an experiment focused on the foundations of Object-Oriented Programming (OOP) using classes and objects in Java. It includes five specific programming tasks, such as counting objects, creating an 'Employee' class to display employee information, calculating the area and circumference of a circle, modeling an invoice item with discounts and taxes, and demonstrating constructor usage for initializing instance variables. The aim is to provide practical application and implementation of OOP concepts.

Uploaded by

rikkukr27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Java Experiment 4

The document outlines an experiment focused on the foundations of Object-Oriented Programming (OOP) using classes and objects in Java. It includes five specific programming tasks, such as counting objects, creating an 'Employee' class to display employee information, calculating the area and circumference of a circle, modeling an invoice item with discounts and taxes, and demonstrating constructor usage for initializing instance variables. The aim is to provide practical application and implementation of OOP concepts.

Uploaded by

rikkukr27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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.

You might also like