From 6654546671eea9f9becd32b3160a134802659cbc Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Thu, 28 Nov 2024 17:26:19 -0500 Subject: Replica2: restrict scope --- src/main/java/derms/replica/replica2/City.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/derms/replica/replica2/City.java') diff --git a/src/main/java/derms/replica/replica2/City.java b/src/main/java/derms/replica/replica2/City.java index b027d44..63aa2cd 100644 --- a/src/main/java/derms/replica/replica2/City.java +++ b/src/main/java/derms/replica/replica2/City.java @@ -2,18 +2,18 @@ package derms.replica.replica2; import java.io.Serializable; -public class City implements Serializable { - public static final int codeLen = 3; +class City implements Serializable { + static final int codeLen = 3; private String code; - public City(String code) throws IllegalArgumentException { + City(String code) throws IllegalArgumentException { if (code.length() != codeLen) throw new IllegalArgumentException("Invalid city: "+code+"; must be "+codeLen+" letters"); this.code = code; } - public City() { + City() { this("XXX"); } -- cgit v1.2.3