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

Is there a guarantee of uniqueness for entity beans?

1061


What is prototype?

1265


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

1198


What is Stream Tokenizer?

2325


Write a singleton program?

1110


what is a non-repeatable read?

2528


What is re-entrant. Is session beans reentrant. Is entity beans reentrant?

1101


What’s jboss cache in short?

1190


What is the difference between long.class and long.type?

1180


What is in-memory replication?

1135


If your ui seems to freeze periodically, what might be a likely reason?

1117


How task's priority is used in scheduling?

2344


How to deploy Jar, War files in J2EE?

2738


wahts is mean by dynavalidatorform in struts/

2122


What do you know about seam?

1134