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

How do you ensure that n threads can access n resources without deadlock?

1314


Does substring create a new object?

1001


Explain java coding standards for constants?

1023


What is the synonym of procedure?

1124


What is a programming object?

1111


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

2823


How variables are declared?

983


Is arraylist ordered?

1082


What function extracts specified characters from a string?

1006


Difference between method overloading and overriding.

1086


Can we make main() thread as daemon?

1110


Name container classes in java programming?

1107


What are the different approaches to implement a function to generate a random number?

1061


What are the types of java languages?

980


Can singleton class be serialized?

953