Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Method Overriding in java

public class Multi{ //Super class
public void multi(){
………………
}
}
 
Public class Multiplication extends Multi(){
Public void multi(){
………..
}
Public static void main(String args[]){
Multi multiplication = new Multiplication(); //Polimorphism is applied
multiplication.multi(); // It calls the Sub class add() method
}
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Method #Overriding #java
ADD COMMENT
Topic
Name
9+8 =