subject
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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Which one of the following identifies the primary a purpose of information classification processes? a. define the requirements for protecting sensitive data.b. define the requirements for backing up data.c. define the requirements for storing data.d. define the requirements for transmitting data.
Answers: 2
question
Computers and Technology, 22.06.2019 00:00
Sam is a data analyst at an advertising firm. he often uses a spreadsheet that contains media ratings details. he would like to filter the spreadsheet data based on different filter criteria. which operators can he use to specify the combination of filter criteria? sam can use the ( blank ) operators to specify a combination of filter criteria.
Answers: 3
question
Computers and Technology, 23.06.2019 10:30
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Helen is having a meeting with her colleagues in her company. they are working on the goals and objectives for the coming year. they want to ensure that these goals and objectives of the processes involved are properly evaluated. which system can helen and her colleagues apply to evaluate this? helen and her colleagues require a blank to evaluate the goals and objectives.
Answers: 2
You know the right answer?
Simple Java question about command line arguments Edit: figured it out myself, args[0] == "one" sho...
Questions
question
History, 25.08.2019 12:00
question
Geography, 25.08.2019 12:00
Questions on the website: 13722361