gudii9
asked on
java preogram output
public class IfElse{
public static void main(String argv[]){
IfElse ie = new IfElse();
ie.go(argv);
}
public void go(String[] sa){
if(sa.length ==0){
System.out.println("No parameter supplied");
}else{
String s = sa[0];
if(s.equals("true")){
System.out.println("OK");
}else if(s.equals("false")){
System.out.println("Not OK");
}else{
System.out.println("Invali d command parameter");
}
}
}
}
I was trying above example from link
http://www.jchq.net/certkey/0201certkey.htm
I was trying to get output 'OK' but could not get it. What change I have to make to output 'OK'. Please advise. Any links, ideas, resources,sample code highly appreciated. thanks in advance.
public static void main(String argv[]){
IfElse ie = new IfElse();
ie.go(argv);
}
public void go(String[] sa){
if(sa.length ==0){
System.out.println("No parameter supplied");
}else{
String s = sa[0];
if(s.equals("true")){
System.out.println("OK");
}else if(s.equals("false")){
System.out.println("Not OK");
}else{
System.out.println("Invali
}
}
}
}
I was trying above example from link
http://www.jchq.net/certkey/0201certkey.htm
I was trying to get output 'OK' but could not get it. What change I have to make to output 'OK'. Please advise. Any links, ideas, resources,sample code highly appreciated. thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You need to provide commad line argument
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.