What's new

Closed String[] args

Status
Not open for further replies.

codyscott

Eternal Poster
Joined
Sep 13, 2017
Posts
388
Reaction
454
Points
279
Another tip para sa inyo mga javadroids!

Kung hindi nyo pa alam kung anong ibig sabihin ng "String[] args" sa:
"public static void main(String[] args)"

Well, useful pala yan... lol!

When you run a java program sa COMMAND LINE, parameters are optional.
For example: >java MyJavaProgram param1 param2 param3
("param1 param2 param3 are optional parameters depende sa code nyo)

This tip teaches you how to do this with ECLIPSE's "COMMAND LINE" (instead of windows commandline)

Here are the steps (snapshots attached):
1) on ECLIPSE, you click RUN (on the menu)
2) click RUN CONFIGURATIONS
3) on left, hit JAVA APPLICATION
4) hit ARGUMENTS tab
5) inside PROGAM ARGUMENTS you type the parameters separated by spaces
6) then click run

That's it.
Instead of running your test sa windows commandline, you can do it here too.
 

Attachments

Status
Not open for further replies.

Similar threads

Back
Top