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 we override static methods?

Answer Posted / amitasite

you cannot override static method from super class.

e.g.,

class SuperType{
public static void method(){
System.out.println("Super Static");
}
}

class SubType extends SuperType{
public void method(){
System.out.println("Super Static");
}
}

It will give compilation error : Instance method cannot
override static method from SuperType

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is javac in java?

1058


what is bmg file and how to create that files?what will it contailn?

2396


What is meant by class loader? How many types are there? When will we use them?

1010


Why is multiple inheritance not supported in java?

1093


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2897


What are the main uses of the super keyword?

1021


What is final method in java?

1086


What is difference between public static and void?

1079


Explain java coding standards for constants?

1066


How do you empty a list in java?

1020


How many types of memory areas are allocated by JVM in java?

1117


Why wait and notify methods are declared in object class?

1085


List the three steps for creating an object for a class?

1018


How will you reverse a link list without using recursion?

1084


What is passing parameters in java?

1101