Assign 3
Assign 3
Output
I am nocturnal!!
I hang upside down!!
I fly !!
class SphereArea
{
double area(int x)
{
return 4 * 3.14 * x * x;
}
}
class CylinderArea
{
double area(int x, int y)
{
return x * y;
}
}
Output
Surface area of cube = 6.0
Surface area of sphere= 50.24
Surface area of cylinder= 12.0
void numberOfSides()
{
System.out.println("side = 0");
}
}
void numberOfSides()
{
System.out.println("side = 4 ");
}
}
void numberOfSides()
{
System.out.println("side= 5");
}
}
void numberOfSides()
{
System.out.println("side = 6 ");
}
}
Output
SQUARE;
side = 4;
PENTAGON;
side= 5
HEXAGON
side = 6
Applications
Real-time System Design – These systems have complexities that make it
very difficult to code and build from scratch. With the help of object-
oriented techniques, it is possible to handle and build these integrated
complex frameworks.
Object-oriented databases – Instead of RDBMS, these systems use Object-
Oriented Database Management Systems (OODBMS). These databases do
not store data such as numbers and strings. Instead, they store everything
as objects. They have mainly two features – attributes and methods.
Office Automation Systems – It includes all modes of electronic
information sharing, which might be business, personal, formal, informal,
that involves the exchange of messages between people and machines.
Simulation and Modelling – Complex modeling systems involve
understanding and modeling interactions as clearly as possible. Object-
oriented methods provide an alternative and simple method for simulating
such processes.