• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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: 24204
44
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 ]
 
Everybody! Do the Funky Monkey! Like this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic