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 are disadvantages of java?
Can you inherit from an abstract class java?
What is meant by object oriented programming – oop?
Is java still necessary?
What is the difference between compare and compareto in java?
What is == and === in javascript?
Define inheritance with reference to java.
What is the maximum size of a string in java?
How do you get length in java?
Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?
How do you invoke a method?
Why is java multithreaded?
how to create multithreaded program? : Java thread
Why is a constant variable important?
What are java packages? What is the significance of packages?