This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML 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:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

strictfp

 
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?
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We cant declare abstract classes as strictfp
 
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 {}
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • 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
Boost this thread!