Skip to content

Commit 0fd2bba

Browse files
committed
Exercise 9-F
1 parent 4611e4e commit 0fd2bba

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

ch09/Exercise9F.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class Exercise9F
2+
{
3+
public static void main(String[] args)
4+
{
5+
printPhoneNumber("501-555-0100");
6+
}
7+
8+
private static void printPhoneNumber (String digits)
9+
{
10+
System.out.println("Area Code: " + digits.substring(0,3));
11+
System.out.println("Exchange: " + digits.substring(4,7));
12+
System.out.println("Line Number: " + digits.substring(8,12));
13+
}
14+
}

0 commit comments

Comments
 (0)