0
How to excute java program using yes or no statements
suppose if i enter yes in the cmd one statement should execute n if I enter no another statement should execute..provide me 1 example...
1 Antwort
+ 5
public static void main (String[] args) {
if (args[0].equals("yes"))
myYesMethod();
else if (args[0].equals("no"))
myNoMethod();
}
Something like that. You could use a switch/case statement as well.