Don't try to use tabs for indenting. Use spaces.
Why rules are different for protected methods and protected variables in java.
They're not. In both cases, a child class from a different package can access the member only as
this.whatever or
super.whatever, Not as
some_other_object_of_this_class.whatever. You must have been doing it one way for methods and the other way for variables.