2 Topics

Member Avatar for
Member Avatar for bRyANthen

I couldn't save the new things when i tried to pass in new value inside inner class. The error message is local variable item is accessed from within inner class; needs to declared final. Guide me please. thanks in advance [CODE] public class Broadcast{ protected String title; public Broadcast(String title){ …

Member Avatar for JamesCherrill
0
195
Member Avatar for begueradj

Hello people, I created an innter class like this [CODE] public class OuterClass{ int attribute=0; class InnerClass { public void method1(){ attribute++; } public void method2(){ System.out.println(attribute); } }[/CODE] My problem is when I call method2() in a correct way, it displays 0 and not 1 as I wanted. Can …

Member Avatar for JamesCherrill
0
213

The End.