• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

strictfp

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We cant declare abstract classes as strictfp
 
Ranch Hand
Posts: 1272
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 {}
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic