This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another concept

 
Richard Wilson
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can an instance method be overriden to be final or synchronized or strictfp or native, which all regarded as kind of implementation property?
 
Phil Sharp
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, a method can be overridden and you can add final, synchronized, native or strictfp.
Note it is not possible to create an abstract method that is final, synchronized, native or strictfp. This is fairly obvious as it would not make sense to do so.
 
Peter Bugla
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I've seen in my studies, there's no
problem with overriding methods to be final or synchronized. I think native should be possible too.
strictfp is not a valid modifier as of JDK1.3, it's just a reserved keyword!
What you can't do is overriding a static method to be non-static and vice versa (Compiler error).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic