• Post Reply Bookmark Topic Watch Topic
  • New Topic

interface - abstract or strictfp ???  RSS feed

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rathi ji:
...we can't use abstract & strictfp at the same time... (?) (in class i am sure we can't)...

 
Andris Jekabsons
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!