• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

K&B page 466 "method-local inner class"

 
Cathy Song
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page 466, it is stated that "The only modifiers you can apply to a method-local inner class are abstract and final."
Consider the following example:
class Outer2
{
private String x = "Outer2";

void doStuff()
{
final int a = 10;
strictfp class Inner2
{
void seeOuter()
{
System.out.println(x);
System.out.println(a);
}
}//end Inner2

Inner2 i = new Inner2();
i.seeOuter();
}//end doStuff
}
It seems strictfp can also be applied to a method-local inner class.
Am I missing something?
Thanks,
Cathy.
 
Vad Fogel
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JLS 14.3
strictfp is not mentioned as causing a compile error modifier.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic