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 / vivek

If a subclass defines a static method with the same signature as a static method in the superclass, the method in the subclass hides the one in the superclass. The distinction between hiding and overriding has important implications.

public class Animal
{
public static void hide()
{
System.out.format("The hide method in Animal.");
}
public void override()
{
System.out.format("The override method in Animal.");
}
}

public class Cat extends Animal
{
public static void hide()
{
System.out.format("The hide method in Cat.");
}
public void override()
{
System.out.format("The override method in Cat.");
}
}

But still I am not convinced with the exact difference in between hiding and overriding a method...???

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is clustering? What are the different algorithms used for clustering?

1056


What is the difference between RMI registry and OS Agent?

1124


Explain how will the struts know which action class to call when you submit a form?

947


To what value is a variable of the string type automatically initialized?

1122


What is a sessionfactory? Is it a thread-safe object?

1205


Which javutil classes and interfaces support event handling?

1025


What is the purpose of the wait() method?

1174


What’s jboss jbpm?

1012


What is the relationship between an event-listener interface and an event-adapter class?

1111


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

1219


If I wanted to use a solarisui for just a jtabbedpane, and the metal ui for everything else, how would I do that?

1037


Explain about RMI Architecture?

1066


How are the elements of a cardlayout organized?

1071


Can I use javascript to submit a form?

1133


What are the different methods of identifying an object?

1050