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.
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
-
You do not have permission to view the full content of this post. Log in or register now.