Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
srikanth reddy
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Debashree Halder
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic