Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

can a static method be overridden

Answer Posted / aswini de

public class Test extends Test2{

public static void main(String args[]){
String str="";
int b=Test.cal(4);
System.out.println(b);
Test t =new Test();
t.displayX();
}

public static int cal(int a){
int b=a*a;
return b;
}

}

public class Test2 {
public static void main(String args[]){

}

public static int cal(int a,int b){
int c=a*b;
System.out.println("IN Super orerriden
methods:");
return c;
}

public void displayX(){
System.out.println("HI i am in Super");
}

}
my Sub Class is Test extends Test2 Class
Common static method is cal()

its run properly. No compile error , NO runtime error

Is This Answer Correct ?    4 Yes 38 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

difference between  ejb,struts,hibernate,spring and jsp

2924


What must a class do to implement an interface?

1282


Is the infobus client side only?

1165


Why does the tag url-encode javascript and mailto links?

1070


the same information whether it will connect to the database or it will be used previous information?

1097


Can I use javascript to submit a form?

1198


Explain ioc concept?

1197


When a thread blocks on i/o?

1170


What are the different methods of identifying an object?

1129


what is Activation Instantinator?

2508


What is the difference between system.out ,system.err and system.in?

1162


what is a non-repeatable read?

2525


What restrictions are placed on the values of each case of a switch statement?

1061


Explain the advantages and disadvantages of detached objects.

1079


What is the purpose of the notify() method?

1137