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

What if the static modifier is removed from the signature of the main method?

1228


what are getters and setters in Java with examples?

1764


What is synchronization and why is it important?

1094


what are RemoteObjects?

2718


Is jvm a overhead?

1077


Describe responsibilities of Activator?

2252


Which characters may be used as the second character of an identifier, but not as the first character of an identifier?

1034


Difference between hashmap and hashtable?

1144


What modifiers may be used with an inner class that is a member of an outer class?

1051


Name three component subclasses that support painting?

1054


What is bean? Where can it be used?

1133


What is RMI and what are the services in RMI?

1144


What class is used to create Server side object ?

2223


What is prototype?

1132


what are the advantages of JTA over JTS?

2186