In Inheritence concept, i have a static method in super
class and i am inheriting that class to one sub class.in
that case the static method is inherited to sub class or
not????

Answer Posted / venkat.kanneganti

Hi,static methods are methods are inherited.
example
class A {
static void methA() {
System.out.println("inside methA");
}
}
class B extends A {
public static void main(String[] args){
B.methA();
}
}
output:inside methA

Is This Answer Correct ?    20 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use a default constructor of a class even if an explicit constructor is defined?

847


What is derived datatype?

888


What Is Composition?

804


What do you mean by platform independence?

795


What is assembly used for?

779


How will you load a specific locale?

746


What is command line used for?

831


What are the topics in advance java?

727


Explain the overview of UDP messaging.

922


What is null in java?

709


What is map java?

740


What is the importance of finally block in exception handling?

788


What is substring in java?

830


What is a pointer and does java support pointers?

784


What are the two basic ways in which classes that can be run as threads may be defined?

823