Specifications

Sun Services
Java™ Programming Language
Module 7, slide 14 of 44
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Blank Final Variables
1 public class Customer {
2
3 private final long customerID;
4
5 public Customer() {
6 customerID = createID();
7 }
8
9 public long getID() {
10 return customerID;
11 }
12
13 private long createID() {
14 return ... // generate new ID
15 }
16
17 // more declarations
18
19 }