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 design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?
Which is better list or arraylist in java?
Explain how hashmap works?
What are the features of java?
What is definition and declaration?
When can we say that threads are not lightweight process in java?
What are keywords in java?
How does varargs work in java?
How do you escape in java?
What is the final keyword?
What is floor math?
What are different types of multitasking?
What do you mean by multithreaded program?
Can you explain inner class.
What is the difference between superclass and subclass?