Skip to content

Commit e16d409

Browse files
committed
reviewed ch01
1 parent 869fc46 commit e16d409

3 files changed

Lines changed: 18 additions & 7 deletions

File tree

ch01/Goodbye.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
/**
2-
* Example program that demonstrates print vs println.
3-
*/
41
public class Goodbye {
52

6-
/**
7-
* Prints a greeting.
8-
*/
93
public static void main(String[] args) {
10-
System.out.print("Goodbye, "); // note the space
4+
System.out.print("Goodbye, ");
115
System.out.println("cruel world");
126
}
137

ch01/Hello2.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
public class Hello2 {
2+
3+
public static void main(String[] args) {
4+
// generate some simple output
5+
System.out.println("Hello, World!"); // first line
6+
System.out.println("How are you?"); // another line
7+
}
8+
9+
}

ch01/Hello3.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public class Hello3 {
2+
3+
public static void main(String[] args) {
4+
System.out.print("Hello!\nHow are you doing?\n");
5+
System.out.println("She said \"Hello!\" to me.");
6+
}
7+
8+
}

0 commit comments

Comments
 (0)