Question: Given the following declaration of a class, which field is accessible from outside the package com.corporation.project? Select the one correct answer. (a) Field i is

Given the following declaration of a class, which field is accessible from outside the package com.corporation.project?

package com.corporation.project; public class MyClass { int i; } public protected private

Select the one correct answer.

(a) Field i is accessible in all classes in other packages.

(b) Field j is accessible in all classes in other packages.

(c) Field k is accessible in all classes in other packages.

(d) Field k is accessible in subclasses only in other packages.

(e) Field l is accessible in all classes in other packages.

(f) Field l is accessible in subclasses only in other packages.

package com.corporation.project; public class MyClass { int i; } public protected private int j; int k; int 1;

Step by Step Solution

3.47 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

b Outside the package the member j is accessible to any class whereas the member k is accessible ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming 8th Questions!