1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
klasskru [66]
3 years ago
8

Simple Java question about command line arguments

Computers and Technology
1 answer:
nlexa [21]3 years ago
3 0

Answer:

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

You might be interested in
The following is a training dataset that has ten one dimensional objects.
grandymaker [24]
Yes no no false . . . .
6 0
3 years ago
Special keys that allow you to use the computer to perform specific functions
Pavel [41]

Answer:

Examples are Ctrl, Alt, Fn, Alt Gr, Shift, Caps Lock, Tab, Scroll Lock, Num lock, Esc, Windows Key, Backspace, Enter...

8 0
3 years ago
Many advertisers are now introducing video ad campaigns that stretch across multiple viewing​ platforms, such as traditional tel
Evgen [1.6K]
The term that best fits the blank provided is DIGITAL VIDEO AD CONVERGENCE. The concept that is being described above is what we call the digital video ad convergence and this covers different types of media platforms as a way to introduce or advertise a product or a service.
8 0
3 years ago
From which tab can you format individual cell data like any other text? A.Design B. Home C. Table Tools Design D.Table Tools Lay
skelet666 [1.2K]
The answer to this question is the letter "B" which is the HOME tab. When you click the home tab, you can find the different number format in such a way that you can also format the individual cell, it could be data of any other text.
6 0
3 years ago
Is windows 7 professional faster than home premium?
Olin [163]
Widows 7 is no longer supported for anti virus, I recommend a windows 10 license
8 0
3 years ago
Other questions:
  • Choosing firm goals for your business
    7·2 answers
  • You can add envelopes to existing documents. <br> a. True <br> b. False
    10·1 answer
  • What education and training is required to be an applications software engineer?
    9·1 answer
  • In python,_______ are used to define the conditions necessary for a while loop to run.
    7·2 answers
  • What does the term hardware refer to?
    13·1 answer
  • For what kind of shot is a fisheye lens most appropriate?
    8·1 answer
  • A selected graphic appears surrounded by a(n) ______, which has small squares and circles around its edges.
    7·1 answer
  • The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use
    6·1 answer
  • Int a = 1; int b = 0; int c = -1; if ((b + 1) == a) { b++; c += b; } if (c == a) { a--; b = 4; }
    7·1 answer
  • A user calls to complain that her computer is behaving erratically. Some days it functions correctly, and other days, it crashes
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!