1

In Java, when I declare a variable final static just like "final static int a;", is "a" protected or public?

Victoria
  • 67
  • 5

1 Answers1

0

When you don't specify an access modifier, it is always default modifier. Default modifier means the field will be accessible from inside the same package to which the class belongs. Checkout some examples of default modifier here

Yogesh D
  • 1,558
  • 14
  • 29
  • I got it! Thanks! I mixed default modifier up with protected. – Victoria Nov 03 '18 at 07:15
  • I think the default is also named "package", no? Meaning that its scope is for the current package. Here's a more official link: https://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html – android developer Nov 03 '18 at 07:30