Beruflich Dokumente
Kultur Dokumente
Abstraction is a way of converting real world objects in terms of class. It’s a concept of defining
an idea in terms of classes or interface. For example creating a class Vehicle and injecting
properties into it.
What is Encapsulation?
The encapsulation is achieved by combining the methods and attribute into a class. The class
acts like a container encapsulating the properties. The users are exposed mainly public methods.
The idea behind is to hide how things work and just exposing the requests a user can do.
Polymorphism
Static: Memory is allocated only once in the program. Common for every object - there memory
location can be sharable by every object reference or same class. Static variable can be accessed
with class reference.
Instance: Memory is allocated whenever a new object is created. Specific to an object. Can be
accessed with object reference.
Interfaces are 100% Abstract. Methods of Interface can be implemented by Classes only.