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

static method can be overriden the case is that in in
subclass that method should also be static.

class A {
static void something () { System.out.println("static method
in A");}
}

class B extends A {
static void something () {System.out.println("static method
in B");}
}

class TestClass{

public static void main(String args[]){

A a = new A();
B b = new B();
A.something();
B.something();

A t = new B();
t.something();
}
}

the output is
static method in A
static method in B
static method in A

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is infobus easy to use?

1086


What are callback interfaces?

1140


Do we need to override service() method

1790


What is local interface. How values will be passed?

1096


Can we sent objects using Sockets?

1202


when A client sent a request to the server to open facebook page and close the browser after this request .at that time the same user do login by using a different browser then that session id will exist or not for the same client??

1592


What must a class do to implement an interface?

1285


In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?

2143


Name three component subclasses that support painting?

1126


What value does read() return when it has reached the end of a file?

1080


How database connectivity in XML is achieved?

2290


What are the types of scaling?

1143


When is the best time to validate input?

1154


Why are component architectures useful?

1123


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

1101