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 a java lambda expression?
What is meant by memory leak?
What is a class in java?
How can we create a thread in java?
What is meant by javabeans?
Is it possible to compare various strings with the help of == operator?
Why singleton pattern is better than creating singleton class with static instance?
Can a private method be declared as static?
What is the method in java?
What is final int?
What two classes are used to read data only?
What is an class?
What are the four pillars of java?
Why java applets are more useful for intranets as compared to internet?
How to make a class or a bean serializable?