OOPs Concepts
OOPs Concepts An object is an instance of a class Object is a bundle of data and its methods (often called methods) Example: class House { String address ; String color ; double are ; void openDoor () { //Write code here } void closeDoor () { //Write code here } ... ... } Abstraction : is the process where you only show "relevant " data and hide the "unnecessary" data from the user accessing the object. When you login to online banking, the only data shown to you is the username and password fields. The process of data transfer is hidden. Encapsulation : means binding object states (fields) and behaviors (methods) together. If you are creating a class, you are encapsulating. (Getters and Setters, making variables private etc.) Inheritance : means inheriting the properties and functionalities of another class. Is used for code re-usability Polymorphism : lets you to define a particular function is