Hi All,
In one of the books I'm refering to for SCJP1.5 says that the anonymous classes can contain only final static fields. But when I tried the below program it actually executed.
class Boo
{
Boo(
String s){}
Boo(){}
void method()
{
}
}
class Bar extends Boo {
Bar(){}
Bar(String s){super(s);}
public static void main(String args[])
{
Boo f = new Boo(){String s;
void mehtod()
{
s= "20";
}
};
}
}
Is it that I'm not reading the statement properly or the book is wrong.
Please correct me if I'm wrong.
Regards,
Sharath