-7

It isn't by default like that? For example:

**public** int [name];
**public** String [name];

1 Answers1

4

By default it's package-private access (allowing any class belonging to the same package to access it), not public.

Anyway, it's bad practice to define data members as public. In most cases they should be private.

Eran
  • 387,369
  • 54
  • 702
  • 768