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 the difference between RMI registry and OS Agent?

1150


What are various types of class loaders used by jvm?

1006


we use MainFrame and using os390 for operating system with DB2 data base in IRAN and interest programing with java and use webspere for world wide,please help me where i should start?

2424


Write a singleton program?

1065


Why a component architecture for the java platform?

1229


Why is actionform a base class rather than an interface?

1073


If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?

2209


what are getters and setters in Java with examples?

1786


What are the different class loaders used by jvm?

1099


Can I use multiple html form elements with the same name?

1061


Which component handles cluster communication in jboss?

1117


Why doesn’t the focus feature on the tag work in every circumstance?

1111


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

1077


Can I map more than one table in a cmp?

1090


What are local interfaces? Describe.

1238