Question on whether Static method can be overriden

Showing Answers 1 - 4 of 4 Answers

Lavanya

  • Apr 17th, 2005
 

No. Static methods do not participate in Overriding.

  Was this answer useful?  Yes

Hari

  • May 9th, 2005
 

Yes, Statis methods can be overridden only final methods cannot be overridden

  Was this answer useful?  Yes

upender

  • May 12th, 2005
 

yes

  Was this answer useful?  Yes

Senthil

  • Aug 10th, 2005
 

Static Methods over loading is of no use for example the below code will produce a output of 
B.m1 
C.m1 
C.m1 
if we remove static in those functions we will get an ouput of  
B.m1 
C.m1 
B.m1 
class C{ 
 
static void m1() 

System.out.println("C.m1"); 


class B extends C{ 
 
static void m1() 

System.out.println("B.m1"); 


 
 
class A 

public static void main(String str[]) 

 
B b = new B(); 
C c = new C(); 
C c1 = new B(); 
b.m1(); 
c.m1(); 
c1.m1(); 
 

 
 
}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions