aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Devaka ExamLab Diagnostic Question 3 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Devaka ExamLab Diagnostic Question 3" Watch "Devaka ExamLab Diagnostic Question 3" New topic
Author

Devaka ExamLab Diagnostic Question 3

J desai
Greenhorn

Joined: Sep 30, 2009
Posts: 5



My confusion is that printMe() is a static method and is inherited by the subclass. I know static methods cannot be overridden. But how can the static method with same name as super class be declared. why doesn't compiler give a Name Clash error.
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 774

Hi J desai,

Welcome to JavaRanch

See JLS Section 8.4 Classes section for details.
It is allowed in subclass to use same static method name of super class.


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

When you declare a method with the same signature as the method of the super class, it is called hiding. See Overriding Vs Hiding for more details...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Harsh Pensi
Ranch Hand

Joined: Aug 05, 2009
Posts: 67
Also to make things confusing, you need to follow the rules of overriding while "hiding" a static method in a subclass


SCJP6 - 93% SCWCD5 - 97%
aslika bahini
Ranch Hand

Joined: Mar 03, 2007
Posts: 111
Hi Desai,

Is the Devaka ExamLab working fine for you? I have installed it in windows XP. I have a hard time to figure out why the clicks for Diagnostic exam & practice exam 1,2,3 links are
not working.

The only link that is working is final exam.


Please share your experience.
Thanks
Saritha
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

I think you asked this before here. Try reinstalling the application. I also installed it and there were no problems...
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Devaka ExamLab Diagnostic Question 3
 
Similar Threads
New user : Hiding and Overriding
Free download SCJP 5.0 exam simulator
this and super
inheritance question
a extends b , which constructor is called in a?