Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in K&B SCJP 5: topic Inner Classes

 
Carlos G�mez
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers

In K&B SCJP 5 book, page 658 says:

"The only modifiers you can apply to a method-local inner class are abstract and final. (Never both at the same time, though.)"

I think that is missing strictfp modifier.

SCJP 1.4
SCJP 1.5

[ December 11, 2006: Message edited by: Carlos G�mez ]
[ December 11, 2006: Message edited by: Carlos G�mez ]
 
Sanjeev Singh
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes strictfp can also be applied in method local inner class.Can anyone explains why is it so?
 
Maneessh saxena
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanjeev,

Strictfp is the modifier which can be used in conjunction with class or method only.this modifier ensures that a class marked as strictfp means that any method code in the class will conform to the IEEE 754 standard rules for floating points. Without that modifier,floating points used in the methods might behave in a platform-dependent way. If you don't declare a class as strictfp, you can still get strictfp behavior on a method-by-method basis, by declaring a method as strictfp.
As this modifier is applied to both method & classes so we can also use this modifier to Metnod Local Inner Class.
I hope it'll help.

Regards
Maneesh Saxena
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

We tried to walk a bit of a tightrope when we wrote the book. Our general strategy was to include the facts that are important for the exam, and not attempt to cover the entire Java specification. So, for instance, on this strictfp issue, we didn't say it because it's an unusual case that's not on the exam.

Likewise, we sometimes list "parts" of a particular API. Usually we will say something like "these are the important methods" - so you know that we're not reproducing the entire API.

In general, remember that we're trying to cover about 110% of what you'll need for the exam, but that's a lot less than all of what's possible in Java!
[ December 11, 2006: Message edited by: Bert Bates ]
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by raunak saxena:
Hi Sanjeev,

Strictfp is the modifier which can be used in conjunction with class or method only.this modifier ensures that a class marked as strictfp means that any method code in the class will conform to the IEEE 754 standard rules for floating points. Without that modifier,floating points used in the methods might behave in a platform-dependent way. If you don't declare a class as strictfp, you can still get strictfp behavior on a method-by-method basis, by declaring a method as strictfp.
As this modifier is applied to both method & classes so we can also use this modifier to Metnod Local Inner Class.
I hope it'll help.

Regards
Maneesh Saxena


Hey, with that kind of prose you should write a book.
 
Maneessh saxena
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Gaunt:


Hey, with that kind of prose you should write a book.


Hi Barry,

I guess you must be kidding

Regards
Maneesh Saxena
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by raunak saxena:


Hi Barry,

I guess you must be kidding

Regards
Maneesh Saxena


Well if you did not write that, then who did?
 
Maneessh saxena
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Gaunt:


Well if you did not write that, then who did?


I have written the same.I studied this topic from Khalid K&B & Mughal.
 
Carlos G�mez
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Bert Bates:

Hi guys,
We tried to walk a bit of a tightrope when we wrote the book. Our general strategy was to include the facts that are important for the exam, and not attempt to cover the entire Java specification. So, for instance, on this strictfp issue, we didn't say it because it's an unusual case that's not on the exam.



I agree with you Bert, if you write a book of the java certification, "you
must write only about java certification". So, I understand you can't cover the entire Java specification.

SCJP 1.4
SCJP 5.0

[ December 12, 2006: Message edited by: Carlos G�mez ]
[ December 12, 2006: Message edited by: Carlos G�mez ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic