aspose file tools
The moose likes Beginning Java and the fly likes interface - abstract or strictfp ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "interface - abstract or strictfp ???" Watch "interface - abstract or strictfp ???" New topic
Author

interface - abstract or strictfp ???

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
an interface is implicitly abstract .
and we can't use abstract & strictfp at the same time .... ( ? ) ( in method i am sure we can't )

so how this doesn't give any error :



[ January 12, 2005: Message edited by: rathi ji ]
[ January 13, 2005: Message edited by: rathi ji ]
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by rathi ji:
...we can't use abstract & strictfp at the same time... (?) (in class i am sure we can't)...



"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Andris Jekabsons
Ranch Hand

Joined: Jan 20, 2004
Posts: 82
Will strictfp have any influence on a class/object at all - besides working with floating-point numbers.
In other words, is this correct: "it doesn't matter where/how strictfp is used, except when calculating floats and doubles"?
Andris
[ January 12, 2005: Message edited by: Andris Jekabsons ]
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Study these strictfp details from The Java Language Specification, then consider how an abstract method might differ from an abstract class or interface.

From 8.1.1.3 strictfp Classes...

"The effect of the strictfp modifier is to make all float or double expressions within the class declaration be explicitly FP-strict (�15.4). This implies that all methods declared in the class, and all nested types declared in the class, are implicitly strictfp."

Ref: http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#251946


From 9.1.1.2 strictfp Interfaces...

"The effect of the strictfp modifier is to make all float or double expressions within the interface declaration be explicitly FP-strict (�15.4)."

Ref: http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html#246350


From 8.4.3.5 strictfp Methods...

"The effect of the strictfp modifier is to make all float or double expressions within the method body be explicitly FP-strict (�15.4)."

Ref: http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#55408


From 15.4 FP-strict Expressions...

"Every compile-time constant expression ... is FP-strict. If an expression is not a compile-time constant expression, then consider all the class declarations, interface declarations, and method declarations that contain the expression. If any such declaration bears the strictfp modifier, then the expression is FP-strict."

Ref: http://java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#249198
[ January 12, 2005: Message edited by: marc weber ]
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3829
Sorry marc & all ,
I was confuse... we can't use strictfp & abstract at the same time for a method ...I have edited that post also ...
Regarding this I have one more doubt that I have posted in SCJP foram the link is this

thanks a lot ...
[ January 13, 2005: Message edited by: rathi ji ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: interface - abstract or strictfp ???
 
Similar Threads
method : abstract - native - synchronized - strictfp
inner interface ????
object of inner class - where can't we make
Arrays - basic question
struts basic example