Given two files:
1. package pkgA; 2. public class Foo { 3. int a = 5; 4. protected int b = 6; 5. public int c = 7; 6. } //from w w w . j ava 2 s . co m 3. package pkgB; 4. import pkgA.*; 5. public class Baz { 6. public static void main(String[] args) { 7. Foo f = new Foo(); 8. System.out.print(" " + f.a); 9. System.out.print(" " + f.b); 10. System.out.println(" " + f.c); 11. } 12. }
What is the result?
Choose all that apply.
D and E are correct.
Variable a has default access, so it cannot be accessed from outside the package.
Variable b has protected access in pkgA
.
A, B, C, and F are incorrect based on the above information.