Given the following declaration of a class, which fields are accessible from outside the package com.corporation.project?
package com.corporation.project; public class MyClass { int i; public int j; protected int k; private int l; }
Select the two correct answers.
(b) and (d)
Outside the package, the member j is accessible to any class, whereas the member k is only accessible to subclasses of MyClass.
The field i has package accessibility, and is only accessible by classes inside the package.
The field j has public accessibility, and is accessible from anywhere.
The field k has protected accessibility, and is accessible from any class inside the package and from subclasses anywhere.
The field l has private accessibility, and is only accessible within its own class.