package methodOverridding;
public class MethodOverRiddingExample7 extends MethodOverRiddingExample6{
public int add(){
System.out.println(" I am from child class");
return 5;
}
public boolean add1(int a){
System.out.println(" I am from child add1");
}
/**
* for method overridding both child class and parent class method return type, method name
* and method argument should be same
*/
}
public class MethodOverRiddingExample7 extends MethodOverRiddingExample6{
public int add(){
System.out.println(" I am from child class");
return 5;
}
public boolean add1(int a){
System.out.println(" I am from child add1");
}
/**
* for method overridding both child class and parent class method return type, method name
* and method argument should be same
*/
}
No comments:
Post a Comment