O'Reilly logo

Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition by Rolf W. Rasmussen, Khalid A. Mughal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Review Questions

4.17 Given the following definition 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.

  1. Field i is accessible in all classes in other packages.

  2. Field j is accessible in all classes in other packages.

  3. Field k is accessible in all classes in other packages.

  4. Field k is accessible in subclasses only in other packages.

  5. Field l is accessible in all classes in other packages.

  6. Field l is accessible in subclasses only in other packages.

4.18 How restrictive is the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required