Did you post the right code?
There is no "protected" keyword anywhere in your class. Just to be correct I compiled your source code in your most recent post.
This is the compile-time error I get:...
Type: Posts; User: syedbhai
Did you post the right code?
There is no "protected" keyword anywhere in your class. Just to be correct I compiled your source code in your most recent post.
This is the compile-time error I get:...
Hello.
You need to learn about scope of a variable in java.
This link may be of help. Variable Scope
Also, it shall help us if we know what exactly your program is doing. Based on that...