why cannot use protected in this class definition?
Megan Lion
Greenhorn
Joined: Mar 02, 2002
Posts: 7
posted
0
protected class Fred{ private int x=0; private Fred(int xval){ x=xval; } }
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
posted
0
top-level classes cannot be protected or private. See JLS 8.1 Class Declaration for detailed information about which modifiers are legal and which are not.