Im trying to test command line arguments in Java. I am typing the name of my program then -c, like below
java myprogram -c
here is my code
System.out.println(args[0]);
System.out.println(args.length);
if (args[0]== "-c")
System.out.println("YES");
when I run the program I get:
-c
1
but not the YES.... can anyone tell me why?