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

cud u help me ... i am struggling with this question... to find all the subsets of a given set for ex.... a,,b,c shud give all the subsets.... i gt the program in c bt nt able to get it in java..... help needed ..

2151


Describe, in general, how java's garbage collector works?

984


What is a class loader?

1706


What value does readline() return when it has reached the end of a file?

1031


What do you know about seam?

980


In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?

2054


For which statements does it make sense to use a label?

1013


Do I have to use jsps with my application?

972


which book is better for jdbc ,servlets and jsp

2046


How can I scroll through list of pages like the search results in google?

918


What are the different algorithms used for clustering?

1021


Why are component architectures useful?

1006


Can I import same package/class twice? Will the jvm load the package twice at runtime?

1082


How will you pass parameters in RMI? Why do you serialize?

1166


How to deploy Jar, War files in J2EE?

2619