Static polymorphism in Java is achieved by method overloading.

In Hinduism, God is SatChitAnanda.
Sat is infinite existence.
Chit is infinite consciousness.
Ananda is infinite bliss.

The creator power of God, is Brahma.
The preserver power of God, is Vishnu.
The destroyer power of God, is Shiva.

In this example, Brahma calls the divinity method in God, with ‘x’.
Vishnu calls the divinity method in God, with ‘x’ and ‘y’.
Shiva calls the divinity method in God, with ‘x’, ‘y’, and ‘z’.

God has overloaded the divinity method, creating static polymorphism.

Java NetBeans project StaticPolymorphism:

class God
{

public String divinity(String x)
{
return (“God” + “\r\n” + “infinite existence” + “\r\n” + “infinite consciousness” + “\r\n” +
“infinite bliss” + “\r\n” + “Brahma” + “\r\n” + “creator god”);
}

public String divinity(String x, String y)
{
return (“God” + “\r\n” + “infinite existence” + “\r\n” + “infinite consciousness” + “\r\n” +
“infinite bliss” + “\r\n” + “Vishnu” + “\r\n” + “preserver god”);
}

public String divinity(String x, String y, String z)
{
return (“God” + “\r\n” + “infinite existence” + “\r\n” + “infinite consciousness” + “\r\n” +
“infinite bliss” + “\r\n” + “Shiva” + “\r\n” + “destroyer god”);
}

}

 

Dynamic Polymorphism