Java Polymorphism

The concept of polymorphism in Java allows us to carry out a single action in various ways. Compile-time polymorphism and runtime polymorphism are the two types of polymorphism used in Java.

Class In Java

A class is a collection or grouping of objects with shared relationships, common behaviors, and identical properties. Here, every class object has fundamental class properties.

Object In Java

A language for object-oriented programming is Java. Breaking large problems down into smaller pieces is the fundamental idea behind the object-oriented methodology.

Java Recursion

Recursion is the process of a function repeatedly invoking itself. There is no need for a looping statement to be executed in the recursion method. With the help of this technique, complex problems can be reduced to more manageable, simpler ones.

Varargs In Java

Variable arguments are abbreviated as “varargs.” An argument of a method in Java can take any number of values. Varargs is the name of this argument, which can accept a variable number of values.

Arguments and Parameters In Java

When a function is called in Java, a value is passed to the function as an argument. While a parameter is a variable that is used to define a specific value when defining a function.

Method Overriding in Java

Method overriding is a term used in Java when a subclass (child class) has a method that is also declared in the parent class. A method used by Java to achieve Run Time Polymorphism is method overriding.

Method Overloading in Java

Method overloading is the practice of having multiple methods with the same name but various parameter values. Compile-time polymorphism is connected to overloading.
Method overloading can be done in two different ways.
Different argument datatypes
Various number of arguments

Methods in Java

A method is a self-contained block of statements or a sub-program of one or more statements that performs a special task when it is called. We can directly pass data in a method called parameters as a passing value. In Java, methods are used to perform certain specific actions and they are also known as functions.