Computers and Technology, 20.09.2020 07:01 noseugh
Simple Java question about command line arguments
Edit: figured it out myself, args[0] == "one" should be args[0].equals("one")
public Class Test{
public static void main(String[] args) {
System. out. println(args[0]);
if(args[0] == "one")
{ System. out. println("onetest");
}
}
}
it compiles and everything, and when I type
> java Test one
into the command line, this is my output
> one
what am i doing wrong, and why isn't it displaying "onetest" it printed "one" because args[0] is equal to "one," but somehow args[0] isn't "one" because it doesn't print "onetest" ???
expected output is
> one
> onetest
Answers: 1
Computers and Technology, 22.06.2019 15:30
To increase sales, robert sends out a newsletter to his customers each month, letting them know about new products and ways in which to use them. in order to protect his customers' privacy, he uses this field when addressing his e-mail. attach bcc forward to
Answers: 2
Computers and Technology, 23.06.2019 07:30
What part of the interface displays the external references contained in a selected cell? the status bar the review tab the scroll bar the formula bar
Answers: 1
Computers and Technology, 24.06.2019 00:20
Describe a data structures that supports the stack push and pop operations and a third operation findmin, which returns the smallest element in the data structure, all in o(1) worst-case time.
Answers: 2
Simple Java question about command line arguments
Edit: figured it out myself, args[0] == "one" sho...
Geography, 05.10.2019 05:40
Spanish, 05.10.2019 05:40
Chemistry, 05.10.2019 05:40
Biology, 05.10.2019 05:40
Mathematics, 05.10.2019 05:40
History, 05.10.2019 05:40
Mathematics, 05.10.2019 05:40
Physics, 05.10.2019 05:40
Spanish, 05.10.2019 05:40
Mathematics, 05.10.2019 05:40