OOPS Archive

Class, Object and the OOP

A class is a set of things or components having some common properties and attributes, and these components are differentiated at any point of time by the values they hold. We call such components as an instance or object of that class. A class is a abstract keyword which generalized a set of similar entities.

Method overloading in Java

The same class may have a multiple methods with the same name, on a condition that they have either different number of arguments or they have arguments of a different type. This concept is known as method overloading in Java.

Method overriding in Java

A subclass having a method with the same name as that of its parent class, such that it has exactly the same arguments as that of the parent method, then it is known as method overriding. Method overriding is also called as runtime polymorphism.

Encapsulation and Abstraction

Encapsulation from what you have learnt googling around, is a concept of combining the related data and operations in a single capsule or what we could say a 'class' in OOP, such that no other program can modify the data it holds or method implementation it has, at a particular instance of time.

Understanding instanceof operator in Java

instanceof operator in java is used to compare object reference variables. It can be used to check if the object referenced by any object reference variable is of a particular type. This is also known as the type comparison operator. The instanceof operator evaluates to return either a true or false.

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.