Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A variable that is not public or private-Java

Hello fellow programmers,

If a variable is defined not to be a public or private defined outside the method such as:

Graphics    goff;
  Image     ii;
  Thread    thethread;

what would the variable be defined as?

like image 421
Nicholas Kong Avatar asked Dec 22 '11 02:12

Nicholas Kong


1 Answers

The variables as defined without any explicit modifier would have an access level of package-private. These variables can only be accessed within its own package. You can read more about access/variable scope levels for java here.

like image 112
CoolBeans Avatar answered Sep 21 '22 18:09

CoolBeans