Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

strictfp

 
cybel sheriden
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i have jdk 1.2.2 and my compiler does not identify strictfp keyword.

A class could be both abstrct and strictfp whereas a method can not?
 
subash chandar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We cant declare abstract classes as strictfp
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can't declare abstract classes as strictfp

Why not? It means that any concrete methods declared in the abstract class will be strictfp.

abstract strictfp class E {}
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abstract classes can, indeed, be strictfp, but individual abstract methods can't. I don't know the rationale for this, but that's the way it is.
 
Mike Gershman
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abstract classes can, indeed, be strictfp, but individual abstract methods can't. I don't know the rationale for this, but that's the way it is.

Since a method overriding a strictfp concrete method does not become implicitly strictfp, strictfp in an abstract method (that is always overridden) would do nothing.

If a method overriding a strictfp method did have to be strictfp, would the same rule apply to synchronized? These are implementation details, not interface specifications like return type. Just as a revised method implementation might be thread-safe without using synchronized, it might produce accurate results without normalizing the intermediate results of calculations.
[ February 08, 2005: Message edited by: Mike Gershman ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic