-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTenUseArgument.java
More file actions
58 lines (53 loc) · 1.83 KB
/
TenUseArgument.java
File metadata and controls
58 lines (53 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/******************************************************************************
* Compilation: javac UseArgument.java
* Execution: java UseArgument yourname
*
* Prints 10 times "Hi, Bob. How are you?" where "Bob" is replaced by the
* command-line argument.
*
* % java UseArgument Bob
* Hi, Bob. How are you?
* Hi, Bob. How are you?
* Hi, Bob. How are you?
* Hi, Bob. How are you?
* Hi, Bob. How are you?
* Hi, Bob. How are you?
* Hi, Bob. How are you?
* Hi, Bob. How are you?
* Hi, Bob. How are you?
* Hi, Bob. How are you?
*
* % java UseArgument Alice
* Hi, Alice. How are you?
* Hi, Alice. How are you?
* Hi, Alice. How are you?
* Hi, Alice. How are you?
* Hi, Alice. How are you?
* Hi, Alice. How are you?
* Hi, Alice. How are you?
* Hi, Alice. How are you?
* Hi, Alice. How are you?
* Hi, Alice. How are you?
*
******************************************************************************/
public class TenUseArgument {
public static void main(String[] args) {
int i;
for (i=1; i<=10; i++) {
System.out.println( i +" Hi, "+args[0]+" "+args[1]+". How are you?");
}
// out loop
System.out.println("i= "+ i);
/*System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
System.out.println( "Hi, "+args[0]+" "+args[1]+". How are you?");
*/
}
}