🔒 Closed String[] args

Status
Not open for further replies.

codyscott

Honorary Poster
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

  • step1.webp
    step1.webp
    58.4 KB · Views: 18
  • step2.webp
    step2.webp
    60.7 KB · Views: 15
  • step3.webp
    step3.webp
    82.2 KB · Views: 15
  • step4.webp
    step4.webp
    70 KB · Views: 13
  • step5.webp
    step5.webp
    83.8 KB · Views: 13
Status
Not open for further replies.

About this Thread

  • 0
    Replies
  • 769
    Views
  • 1
    Participants
Last reply from:
codyscott

Trending Topics

Online now

Members online
1,156
Guests online
1,080
Total visitors
2,236

Forum statistics

Threads
2,274,699
Posts
28,957,709
Members
1,233,404
Latest member
Carameltzy
Back
Top