... public int getAccountNumber() {
23         return accountNumber;
24      }
25
26      // sets the makeAndModel
27      public void setMakeAndModel(String makeAndModel) {
28         this.makeAndModel = makeAndModel;
29      }
30
31      // returns the makeAndModel
32      public String getMakeAndModel() {
33         return makeAndModel;
34      }
35
36      // sets the state
37      public void setState(String state) {
38         this.state = state;
39      }
40
41      // returns the state
42      public String getState() {
43         return state;
44      }
45
46      // predicate method returns whether the state has no-fault insurance
47      public boolean isNoFaultState(){
48         boolean noFaultState;
49
50         // determine whether state has no-fault auto insurance
51         switch (getState()) { // get AutoPolicy object's state abbreviation
52            case "MA": case "NJ":  ...

Get Java How to Program, Early Objects, 11th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.