Tag

#java OOP program

9 posts

Example of this keyword in Java

In this tutorial, we will write this keyword program in java. Before that, you should have knowledge on the following topic in Java. this keyword in Java Example of this keyword in Java in constructor: Output: Name: Daniel marks:90 this: Invoke current class method: The method of the current class c

September 19, 2021Read more →

Java example of Inner Class

In this tutorial, we will write an inner class program in java. Before that, you should have knowledge on the following topic in Java. Inner class in Java Example of Inner class in Java To demonstrate the example if Member inner Class in Java: Output: Inner class Acceseed Example: Accessing sta

September 19, 2021Read more →

Example of Constructor in Java

In this tutorial, we will write a constructor program in java. Before that, you should have knowledge on the following topic in Java. Constructor in Java Constructor program in Java Basic Example for displaying the default values in Java: Output: 0 null 0 0 null 0 Example of Parameterized Constructo

September 19, 2021Read more →

Java Program for Super keyword

In this tutorial, we will write a program in java for the use of super keyword. Before that, you should have knowledge on the following topic in Java. Super Keyword in Java Java Program for Super keyword Example of a super keyword to differentiate the members of the superclass from a subclass.

September 19, 2021Read more →

Inheritance Example in Java

In this tutorial, we will write an Inheritance program in java. Before that, you should have knowledge on the following topic in Java. Inheritance in Java Basic Example for Inheritance: Output: My Name is Bruno German Shepard Example of Single Inheritance in Java: Output: Super class method Base cla

September 19, 2021Read more →

Polymorphism Example in Java

In this tutorial, we will write a polymorphism program in java. Before that, you should have knowledge on the following topic in Java. Polymorphism in Java 1. Method Overloading: Method Overloading allows the user to have more than one method that has the same name, they are differed by the number o

September 19, 2021Read more →

Encapsulation Example in java

In this tutorial, we will write an encapsulation program in java. Before that, you should have knowledge on the following topic in Java. Java Encapsulation Encapsulation in Java using setter and getter Output: Student Id: 1101 Student Name: Marshall Student Age: 20

September 19, 2021Read more →

Example of Abstraction in Java

In this tutorial, we will write a java program to demonstrate abstraction. Before that, you should have knowledge on the following topic in Java. Abstraction in Java Example of Abstraction in Java Source code: Example of abstract class in java: Output: Cat meows Dog barks

September 19, 2021Read more →

Example of Method Overriding and Overloading in Java

In this tutorial, we will write a program for method overriding and method overloading. Before that, you should have knowledge on the following topic in Java. Java Method Overriding Java Method Overloading Example of method overriding in Java: Output method overriding: I am A Dog Breed: German Shepa

October 30, 2020Read more →