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
What is the use of object and class classes?
What is anagram number?
Why is method overloading not possible by changing the return type in java?
What does next mean in java?
Give the hierarchy of inputstream and outputstream classes.
What is an example of declaration?
How infinite loop is declared?
What mechanism does java use for memory management?
If an object is garbage collected, can it become reachable again?
Define how does a try statement determine which catch clause should be used to handle an exception?
what is the purpose of "virtual"?
Explain what access modifiers can be used for variables?
What is a functional interface?
Difference between character constant and string constant in java ?
Which class is the superclass for every class in java programming?