Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e153e6

Browse files
authored
Merge pull request#160 from Poulami769988/main
Command Line Argument using Java.
2 parents9103f51 +58bef58 commit0e153e6

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

‎Command_Line_Argument.java‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
publicclassCommand_Line_Argument {
3+
4+
publicstaticvoidmain(String[]args) {
5+
// TODO Auto-generated method stub
6+
for(inti =0;i<args.length;i++) {
7+
System.out.println("args["+i+"]= "+args[i]);
8+
//System.out.println("Welcome");
9+
}
10+
inta =Integer.parseInt(args[0]);
11+
/*
12+
Integer.parseInt is use to typecast String to integer.
13+
Here Integer is a class
14+
*/
15+
System.out.println(a);
16+
floatf =Float.parseFloat(args[1]);
17+
System.out.println(f);
18+
19+
doubled =Double.parseDouble(args[2]);
20+
System.out.println(d);
21+
22+
23+
}
24+
25+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp