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 rule of accessibility in java?
What is a flag value?
What are the characteristics of Final,Finally and Finalize keywords.
what is interface in java? Explain
What is the difference between this() and super() in java?
What are methods in java?
which pattern is default in scanner package?
What are the three parts of a lambda expression?
How does finally block differ from finalize() method?
What is the biggest integer?
What is the function of log?
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
Why string is called as immutable?
Is java based on c?
What is java util collection?