wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes can i use the non-access modifier strictfp with abstract for a method declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "can i use the non-access modifier strictfp with abstract for a method declaration" Watch "can i use the non-access modifier strictfp with abstract for a method declaration" New topic
Author

can i use the non-access modifier strictfp with abstract for a method declaration

srikanth reddy
Ranch Hand

Joined: Jul 28, 2005
Posts: 252
hi frnds ,
can i use the non-access modifier abstract with strictfp for a method declaration,coz in KnB it is contradicting....

like...abstract strictfp void foof();

thanks & regards

srikanth


Thanks & Regards<br /> <br />-Srikanth
Marcelo Ortega
Ranch Hand

Joined: May 31, 2005
Posts: 519

You actually can't because you are simply defining a contract between the abstraction and a conctrete class which says the concrete class MUST implement the method, but it does not say anything about HOW it will be implemented. Therefor saying the method is going to comply with the IEE754 standard would not be right.

hth.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJD, SCEA/OCMJEA

Live life to an interface, not an implementation!
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I'd like to point out that a question like this is easy to answer for yourself by simply trying the code with a compiler. This is stongly recommended as a tool for learning. Of course Marzo's answer is good for explaining why the compiler behaves this way.


"I'm not back." - Bill Harding, Twister
Debashree Halder
Ranch Hand

Joined: Jul 27, 2005
Posts: 81
Abstract methods cannot be marked as synchronized,strictfp, or native,all of which are modifiers describing something about the implementation of a method.bacause abstract methods define the signature,access, and return type,but can say nothing about implementation,following method declarations are illegal.

abstract synchonized void amethod();
abstract strictfp void amethod();
abstract native void amethod();


Debashree Halder<br />SCJP 1.5<br />Washington DC
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can i use the non-access modifier strictfp with abstract for a method declaration