瀏覽代碼

Update 'CodeSamples/codeSamples/CallingMethodsInSameClass.java'

Kristofer Younger 6 年之前
父節點
當前提交
8b01370df0
共有 1 個文件被更改,包括 24 次插入22 次删除
  1. 24
    22
      CodeSamples/codeSamples/CallingMethodsInSameClass.java

+ 24
- 22
CodeSamples/codeSamples/CallingMethodsInSameClass.java 查看文件

@@ -1,23 +1,25 @@
1
-/* CallingMethodsInSameClass.java
2
- *
3
- * illustrates how to call static methods a class
4
- * from a method in the same class
5
- */
6
-
7
-public class CallingMethodsInSameClass
8
-{
9
-	public static void main(String[] args) {
10
-		printOne();
11
-		printOne();
12
-		printTwo();
13
-	}
14
-
15
-	public static void printOne() {
16
-		System.out.println("Hello World");
17
-	}
18
-
19
-	public static void printTwo() {
20
-		printOne();
21
-		printOne();
22
-	}
1
+/* CallingMethodsInSameClass.java
2
+ *
3
+ * illustrates how to call static methods a class
4
+ * from a method in the same class
5
+ */
6
+
7
+public class CallingMethodsInSameClass
8
+{
9
+	public static void main(String[] args) {
10
+      
11
+      // Don't choose this one either. :-)
12
+		printOne();
13
+		printOne();
14
+		printTwo();
15
+	}
16
+
17
+	public static void printOne() {
18
+		System.out.println("Hello World");
19
+	}
20
+
21
+	public static void printTwo() {
22
+		printOne();
23
+		printOne();
24
+	}
23 25
 }