aspose file tools*
The moose likes Beginning Java and the fly likes strictfp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "strictfp" Watch "strictfp" New topic
Author

strictfp

cybel sheriden
Ranch Hand

Joined: Jan 18, 2005
Posts: 50
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

Joined: Feb 07, 2005
Posts: 8
We cant declare abstract classes as strictfp
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
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 {}


Mike Gershman
SCJP 1.4, SCWCD in process
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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.


[Jess in Action][AskingGoodQuestions]
Mike Gershman
Ranch Hand

Joined: Mar 13, 2004
Posts: 1272
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: strictfp