Create a class named 'Box' with three data members- length, breadth and height and a method to calculate the volume which is 'lengthbreadthheight'. The class has three constructors which are : 1 - Having no parameter - values of both length, breadth and height are assigned zero. 2 - Having three numbers as parameters - the three numbers are assigned as length, breadth and height respectively. 3 - Having one number as parameter - all length, breadth and height are assigned that number. Now, create objects of the 'Box' class having none, one and three parameters and print their volume.
-
Notifications
You must be signed in to change notification settings - Fork 2
rishavraj12321/Constructor_Overloading
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published