ProAnswers.org

What is Default access level?

When there is no access control modifier preceding a class declaration, the class has the default access level. Classes with the default access level can only be used by other classes that belong to the same package.

The Chapter class with the default access level is defined as follows.

 

class Chapter {

    String title;

    int numberOfPages;

 

    public void review() {

        Page page = new Page();

        int sentenceCount = page.numberOfSentences;

        int pageNumber = page.getPageNumber();

    }

}