• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in K&B SCJP 5: topic Inner Classes

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes strictfp can also be applied in method local inner class.Can anyone explains why is it so?
 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic