Skip to content

Commit d099d12

Browse files
author
Yalun Qin
committed
Merge TestArray and rename CastTest to TestCast
1 parent c55f377 commit d099d12

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

ArrayTest.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

TestArray.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,9 @@ public static void main (String[] args) {
8383
//Should output cat's info too
8484
System.out.println("New animal = " + newAnimal);
8585
}
86+
87+
Object[] strings = new String[2];
88+
strings[0] = "hi"; // OK
89+
strings[1] = 100; // A run-time ArrayStoreException is thrown.
8690
}
8791
}

CastTest.java renamed to TestCast.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CastTest {
1+
class TestCast {
22
public static void main(String[] args) {
33
Animal animal1 = new Animal(5, 6);
44
Animal animal2 = new Cat(1, 2, 3);

0 commit comments

Comments
 (0)