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 static methods be overridden?

Answer Posted / sumit pal singh

static class Class1 {
    public static int Method1(){
          return 0;
    }
}
static class Class2 extends Class1 {
    public static int Method1(){
          return 1;
    }




}
public static class Main {
    public static void main(String[] args){
            
          Class1.Method1();
          Class2.Method1();
    }
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

give an example for encapsulation?

1041


What is difference between path and classpath in java?

1016


Is java same as core java?

1092


Can we have two methods in a class with the same name?

1049


What is the difference between a checked and an unchecked exception?

988


How many functional interfaces does java 8 have?

1026


What is a "pure virtual" member function?

1089


I want to persist data of objects for later use. What is the best approach to do so?

1058


What are the Main functions of Java?

1089


What about anonymous inner classes in java?

1032


Difference between default and protected access specifiers?

1119


What is ordered map in java?

1001


How will you serialize a singleton class without violating singleton pattern?

1952


Explain java code for recursive solution's base case?

1025


Why is java multithreaded?

984