Jay
Jay

Reputation: 13

Java package inheritance, simple query

I am new to stackoverflow and Java programming. I was practicing inheritance with sample code and I was wondering if there is any access modifier that will allow the variable to be accessed by methods in the same package.

Thanks

UPDATE:

Found the answer. Package modifier does the trick.

Upvotes: 0

Views: 231

Answers (1)

Lucas
Lucas

Reputation: 14939

default modifier, in other words, no modifier (not public, not private, and not protected):

void doSomething() {
}

Upvotes: 5

Related Questions