Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

0 votes
34 views
asked by Geek (15.3k points) 19 43 70

1 Answer

0 votes
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();
    }
}
 
answered by Expert (15k points) 15 23 32

Related questions

+1 vote
1 answer 65 views
0 votes
1 answer 33 views
33 views asked by john Guru (27.1k points) 35 53 115
0 votes
1 answer 9 views
9 views asked by omari Sr Member (3.9k points) 5 8 12
0 votes
1 answer 53 views
53 views asked by smith Geek (15.3k points) 19 43 70
0 votes
1 answer 2.1k views
...