aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes K&B page 466 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "K&B page 466 "method-local inner class"" Watch "K&B page 466 "method-local inner class"" New topic

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

Cathy Song
Ranch Hand

Joined: Aug 24, 2003
Posts: 270
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()
}//end Inner2

Inner2 i = new Inner2();
}//end doStuff
It seems strictfp can also be applied to a method-local inner class.
Am I missing something?
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
JLS 14.3
strictfp is not mentioned as causing a compile error modifier.
I agree. Here's the link:
subject: K&B page 466 "method-local inner class"
Similar Threads
where final variable reside ?
Doubts regarding Method Local Inner Class
Method-local inner class and final local variable
Code for Method-Local Inner Classes not compiling
Final variable access from class inside function