🔒 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: 20
  • step2.webp
    step2.webp
    60.7 KB · Views: 17
  • step3.webp
    step3.webp
    82.2 KB · Views: 17
  • step4.webp
    step4.webp
    70 KB · Views: 15
  • step5.webp
    step5.webp
    83.8 KB · Views: 15
Status
Not open for further replies.

About this Thread

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

Trending Topics

Online now

Members online
1,056
Guests online
1,570
Total visitors
2,626

Forum statistics

Threads
2,285,480
Posts
29,030,540
Members
1,218,488
Latest member
gervgerv
Back
Top