This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

How to deal with these problems in SCJP2?  RSS feed

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still feel blurry about the following two concepts:
SCJPs experts plz give me some tips from exam's point of view:
1. A static method can/cannot be overriden? what is the difference between overriding and hiding? (I just don't get it from reading JLS).
2. An inner class means a nonstatic inner class/static and nonstatic both?
Thanx in Advance.
 
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Overriding implies run-time polymorphism. Calls to <CODE>static</CODE> methods are resolved at compile time so there is no real run-time polymorphism. If you write a static method in a subclass with the same signature and return type as one in the superclass, you are hiding the superclass method because the one in the subclass is now resolved at compile time.
2) <CODE>static</CODE> "inner" classes are really nested classes, not inner. Although Sun has not been consistent with the language used.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i agree with tony.many a times the language used is ambiguous.one can't be sure what exactly the statement means.i think such ambiguity shouldn't be there in such exams.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Method Overriding: Methods can always be overrided provided over-riding method and over-riden method , both should be either static or both of them be non-static . We cannot mix them.

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason, have alook at Carl's notes :
http://www.crosswinds.net/~cdesboro/
I think his explanation is pretty neat.
Ankur
[This message has been edited by Ankur (edited July 07, 2000).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!