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

Can we nested try statements in java?

1045


What is private static class in java?

972


What loop means?

904


What is the static field modifier?

1067


Difference between final and effectively final ?

1026


When throw keyword is used?

992


Is ++ operator thread-safe in java?

1104


Which package is used for pattern matching with regular expressions?

1057


How do you implement polymorphism in our day to day life?

3178


Write java program to reverse string without using api?

982


What is Enum in Java?

1208


What is a boolean output?

916


How can we make a class singleton?

1008


What is the finalize method do?

1049


Explain what access modifiers can be used for methods?

1031