What legally fill in the blank so you can run the main() method from - ProProfs Discuss
Advertisement

What legally fill in the blank so you can run the main() method from the command line?

What legally fill in the blank so you can run the main() method from the command line?

Change Image    Delete

public static void main( )

Asked by Alexpoiry, Last updated: Nov 25, 2024

+ Answer
Request
Question menu
Vote up Vote down

4 Answers

Robert Hazlewood

Robert Hazlewood

Here to relax my mind a bit

Robert Hazlewood
Robert Hazlewood, Senior Executive, MBA, Louisville

Answered Oct 21, 2020

Run a Java application from the control line. Just like any application, a JAR application recognizes many different arguments. It depends upon the application's needs, and this allows the user to identify configuration information when the application was introduced.

As a result, the application can avert hardcoded values and still manage many distinct use cases. An dispute can contain any alphanumeric characters, Unicode characters, and possibly some special characters permitted by the shell.

One or more spaces separate ideas. If an argument needs to include spaces, the spaces must be confined between quotes. Either single quotes or double quoter works fine. Usually, when referring to the application, the user enters command-line arguments after the class's name for the typical Java application.

upvote downvote
Reply 

Olive landon

Olive landon

Science has been working for years in the health department and it has caught my attention since in was in school and I found it very intriguing.

Olive landon
Olive landon, Health science specialist, Master of Health Science (MHS), Logdon, Utah

Answered Sep 21, 2020

As far as I know, the command line has to do with java main method being public, The central issue and maybe most troublesome as well. I made a decent attempt to locate a valid justification for this inquiry in all great learning material in my compass, yet nothing demonstrated enough.

Along these lines, my examination says (in the same way as other others): the main method is public with the goal that it very well may be open all over and to each protest, which may want to utilize it for dispatching the application.

Here, I am not saying that JDK/JRE had comparable reasons on the grounds that java.exe or javaw.exe (for windows) utilize Java Native Interface (JNI) calls to conjure technique, so they can have summoned it whichever way regardless of any entrance modifier.

Note; on the off chance that you don't ensure the main method public, there is no aggregation mistake.

upvote downvote
Reply 

M. Krasinski

M. Krasinski

M. Krasinski
M. Krasinski, Content Writer, Columbus

Answered Sep 10, 2020

There are four correct answers to this question. The first is String[] _names. This is correct because of the underscore in the answer, as any variables and names would begin with an underscore. The next two correct answers are String abc[] and String _Names[]. They are correct because of the [], which is the array operator.

Here they come after the variable name, which is suitable. The last correct answer to this question is String... $n because the varargs are acceptable to be used as a substitution for arrays. These commands are related to Java, which is a programming language. To be able to use the programming language, it is important to know these commands.

upvote downvote
Reply 

alexpoiry

alexpoiry

alexpoiry
Alexpoiry

Answered Apr 14, 2018

String[] _names
String abc[]
String _Names[]
String... $n

A, C, D, E. Option A is correct because it is the traditional main() method signature and variables may begin with underscores. Options C and D are correct because the array operator may appear after the variable name. Option E is correct because varargs are allowed in place of an array. Option B is incorrect because variables are not allowed to begin with a digit. Option F is incorrect because the argument must be an array or varargs. Option F is a perfectly good method. However, it is not one that can be run from the command line because it has the wrong parameter type.
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.