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 / nisha

/* STATIC METHODS CANT BE OVERRRIDDEN....*/

class Animal {
static void doStuff() {
System.out.print("a ");
}
}

class Dog extends Animal {
static void dostuff() { // it's a redefinition,
// not an override
System.out.print("d ");
}

public static void main(String [] args) {
// Animal [] a = {new Animal(), new Dog(), new Animal()};
// for(int x = 0; x < a.length; x++)
// a[x].doStuff(); // invoke the static method

dostuff();
Animal a=new Dog();
a.doStuff();
}
}

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is message driven beam?

1073


What do you know about seam?

1062


Define the remote object implementation?

2513


What class is used to create Server side object ?

2255


wahts is mean by dynavalidatorform in struts/

2080


what is an isolation level?

2762


What are the different types of exception?

1038


What is threadfactory?

1104


How substring() method of string class create memory leaks?

1049


how do you Handle Front End Application data against DB with example?

1983


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

1059


If your ui seems to freeze periodically, what might be a likely reason?

1044


What is the RMI and Socket?

1061


What is the difference between static and non-static with examples?

1948


What are the difference between RMI and CORBA?

1119