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 / kiran sangeri

no,bcos look at below code

package test;

class A {
static void something () {
System.out.println("class A");
}
}

class B extends A {
static void something () {
System.out.println("class B");
}
}


public class ClassC {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
A anA = new B ();
anA.something ();
}

}

Output : class A

so Class A is not been overridden.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between hashmap and hashtable?

1165


What is the difference between RMI registry and OS Agent?

1149


Why won’t the jvm terminate when I close all the application windows?

1248


Why does the option tag render selected=selected instead of just selected?

1179


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

1035


what are getters and setters in Java with examples?

1782


What is metaspace?

1037


Do I have to use jsps with my application?

1027


What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?

1035


What is the difference between a menuitem and a checkboxmenuitem?

1120


when A client sent a request to the server to open facebook page and close the browser after this request .at that time the same user do login by using a different browser then that session id will exist or not for the same client??

1546


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

1153


Which container method is used to cause a container to be laid out and redisplayed?

1140


what is a non-repeatable read?

2433


What are the purpose of introspection?

1221