• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Devaka ExamLab Diagnostic Question 3

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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.
 
Ranch Hand
Posts: 814
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 9674
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also to make things confusing, you need to follow the rules of overriding while "hiding" a static method in a subclass
 
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9674
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you asked this before here. Try reinstalling the application. I also installed it and there were no problems...
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic