Dynamic polymorphism in Java is achieved by method overriding.
Realized Indian yogis perceive that everything within creation, and everything beyond creation, is God.
A pantheon of Hindu gods has been defined, to describe the characteristics, or properties of God.
Divine avatars like Brahma, Vishnu, and Shiva, are extensions of One infinite existence,
infinite consciousness, infinite bliss.
In this example, Brahma, Vishnu, and Shiva all have divinity methods that override God’s
divinity method… creating dynamic polymorphism.
Java NetBeans project DynamicPolymorphism:
/*
SuperClass God
*/
class God{
// divinity method
public String divinity(){
return (“God” + “\r\n” + “infinite existence” + “\r\n” + “infinite consciousness” + “\r\n” + “infinite bliss”);
}
}
/*
SubClasses Brahma, Vishnu, and Shiva
keyword extends overrides SuperClass divinity method
*/
class Brahma extends God{
// divinity method
public String divinity(){
return (“Brahma” + “\r\n” + “creator god”);
}
}
class Vishnu extends God{
// divinity method
public String divinity(){
return (“Vishnu” + “\r\n” + “preserver god”);
}
}
class Shiva extends God{
// divinity method
public String divinity(){
return (“Shiva” + “\r\n” + “destroyer god”);
}
}