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 / kiran sangeri

no,bcos look at below code

package test;

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

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


public class ClassC {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
A anA = new B ();
anA.something ();
}

}

Output : class A

so Class A is not been overridden.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are local interfaces? Describe.

1207


What is the difference between the string and stringbuffer classes?

1081


What are the different types of exception?

1018


What are transaction attributes?

1089


how to make a index.jsp for running the site in internet and find an error for connection with weblogic server and java that give an error invalid object name.and how to maintain session.

2226


Can I have an action without a form?

1086


what is a portable component?

1983


What is clustering? What are the different algorithms used for clustering?

1054


What is the purpose of the notify() method?

1047


Why are component architectures useful?

1047


Define the remote object implementation?

2484


What is local interface. How values will be passed?

1010


Which textcomponent method is used to set a textcomponent to the read-only state?

1114


What is prototype?

1127


Write a singleton program?

1025