Skip to content

Commit d490e12

Browse files
PapeThePopet2013anurag
authored andcommitted
Create greater.java (hacktoberfest17#1184)
1 parent 1b4306c commit d490e12

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
public class greater{
2+
public static void main(String[] args){
3+
try{
4+
if(args.length!=2){
5+
System.out.println("You have to type in just 2 Numbers.");
6+
}
7+
else{
8+
if(Integer.parseInt(args[0])>Integer.parseInt(args[1]))
9+
{
10+
System.out.println(args[0] + " is greater then " + args[1]);
11+
}
12+
else{
13+
System.out.println(args[1] + " is greater then " + args[0]);
14+
}
15+
}
16+
}
17+
catch(NumberFormatException e)
18+
{
19+
System.out.println("You have to type in 2 >Numbers<");
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)