Category Archive for: Java for Beginners

Java Inheritance

Now its time for us to get into Java Object Oriented Programming concepts (OOP). Inheritance is defined as defining the common features (eg. variables & methods) in a single class and reusing them by using the sub objects. Sub objects means the sub classes which inherits the common feature class. Inheritance: Parent Class – The…

Read More →

Java Overriding

Overriding is one of the important concept in Polymorphism. In Inheritance, say if a sub class has different implementation of one of the certain method in the parent class, then it needs to be overrided in the sub class. Overriding: The overriding method in the subclass should have same name, number and type of parameters…

Read More →

Java Polymorphism

Polymorphism means many forms and it is one of the key concepts of Object oriented programming in java. As you all know, in the Inheritance section we have discussed that the sub classes have their own unique features and also shares some of the common features in their parent class. Sub classes do override some…

Read More →

Java Abstraction

Abstraction in OOP is where creating interface or abstract classes to define the common behavior and reuse or implement it by extending it. In Java, Abstraction works with a keyword called Abstract. Abstract Class: A class declared with a keyword ‘abstract’ is said to be Abstract class. This abstract classes cannot be instantiated. It can be…

Read More →

Java Encapsulation

Encapsulation is one of the key concepts of Object Oriented programming which has benefits such as flexibility and maintainability. It is defined as hiding the fields of an object without getting updated or misused. Encapsulation: Encapsulation is done when the instance variables are marked with the ‘private’ access modifier. Then, having getters and setters (methods)…

Read More →

Back to Top