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

OOP Concepts for Beginners

The document outlines the creation of a Parent Class 'Vehicle' with various attributes and methods, utilizing access specifiers and getter/setter methods. It also describes the creation of child classes 'Car', 'Bike', and 'Truck' that inherit from 'Vehicle', as well as a Parent class 'Man' with child classes 'Sameer' and 'Ramesh' to demonstrate runtime polymorphism. Additionally, it includes a class 'Multiplication' with overloaded methods for multiplying numbers and provides definitions for concepts such as inheritance, polymorphism, method overloading, and method overriding.

Uploaded by

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

OOP Concepts for Beginners

The document outlines the creation of a Parent Class 'Vehicle' with various attributes and methods, utilizing access specifiers and getter/setter methods. It also describes the creation of child classes 'Car', 'Bike', and 'Truck' that inherit from 'Vehicle', as well as a Parent class 'Man' with child classes 'Sameer' and 'Ramesh' to demonstrate runtime polymorphism. Additionally, it includes a class 'Multiplication' with overloaded methods for multiplying numbers and provides definitions for concepts such as inheritance, polymorphism, method overloading, and method overriding.

Uploaded by

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

1.

Create a Parent Class "Vehicle" with attributes (name, numberOdWheels,


numberOfGear, numberOfSeats, speedLimit etc) and behaviors/methods (moves, honk
etc)
->use concept of access specifier(public,private and protected) for each
attributes
->use getter and setter to access private attributes
2. Create Children classes Car, Bike, Truck from Vehicle Parent class
->Override the attributes and behaviors
3. Create a Parent class Man and two children classes Sameer and Ramesh with
required attributes and behaviors.
-> Use concept of Runtime polymorphism to hold Child class objects(Sameer and
Ramesh) into Parent(Man) class.
4. Write a class Multiplication having three overloaded methods:
-> multiplyNumbers(a,b)
-> multiplyNumbers(a,b,c)
-> multiplyNumbers(a,b,c,d)
5. What is inheritance?
What is polymorphism
Difference between compile-time and run-time polymorphism
What is method overloading
What is method overriding

You might also like