Computer Science, asked by nikusadnp9t2hy, 6 months ago

What will be the output of the following Java program?
class c
{
public void main(String[] args)
{
System.out.println("Hello" + args[0]).
}
}
Select one:
O a. Runtime Error
O b. Hello
Oc Hello C
Od. Hello world​

Answers

Answered by CoderRishav
2

Answer:

hello-

This is the answer

Answered by Jasleen0599
1

Option B) Hello

JAVA CODE

class c

{

public void main(String[] args)

{

System.out.println("Hello" + args[0]).

}

}

OUTPUT

Hello

  • It is a java.lang array that saves Java command-line parameters. String type. The String array in this example has the name args, but the user is free to substitute any other name for it.
  • The length of the args[] array indicates how many elements are there. The command-line arguments given to the main function are contained in the args[] array.
  • It's not required to always name something args; you can also name it strArray or anything else you like. However, most programmers prefer to name things args because that's what other people do. By the way, you may give a String parameter to your Java programme using "Launch Configuration" if you use Eclipse to run Java programmes.

#SPJ2

Similar questions