-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeybuddy.java
More file actions
36 lines (34 loc) · 750 Bytes
/
Heybuddy.java
File metadata and controls
36 lines (34 loc) · 750 Bytes
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
import java.io.*;
public class heybuddy
{
public static void main (String[] args)
{
Boolean old = null;
old = IsSwitchValued(args, "-o");
try
{
if(old)
{
System.out.println("Hello World!");
}
else
{
System.out.println("Hey Buddy.");
}
}
catch (Exception e)
{
System.err.println("Something's wrong.");
System.err.println(e.getMessage());
}
}
public static boolean IsSwitchValued(String[] args, String strSwitch)
{
for(int i = 0; i < args.length; i++)
{
if(args[i].equals(strSwitch))
return true;
}
return false;
}
}