You are on page 1of 3

301- OBJECT ORIENTED PROGRAMMING EXERCISE

1. Define OOP. Object Oriented Programming (OOP) is a programming technique that uses objects to design the applications and computer programs.

2. Define Object, Class, Encapsulation, Inheritance, Polymorphism. a. Object is the term used to explain many things. An Object consists of data and method. b. Class is a set of objects that have similar attributes(characteristics, which can be seen.) and methods. c. Encapsulation is a process of tying together all data and methods that form a class and control the access to data by hiding its information. d. Inheritance is to create a new class from an existing class together with new attributes and behaviours. e. Polymorphism is a process of giving the same message to two or more different objects and produce different behaviours depending on how the objects receive the message.

3. Write a simple coding to create a method.

Coding

Output

4. Why we need to create Exception Handling??

Exception handling enables programmers to create applications that can resolve (or handle) exceptions

You might also like