How eclipse passes arguments to the main method

Source: Internet
Author: User

Import java.util.arrays;/** * This is a test class, used to study the value of the main method of the problem * @author HHB */public class Test {/** * This is the main method of the class, to accept the user's input, and to save the input data to the An array of type String * @param args */public static void main (string[] args) {System.out.println (arrays.tostring (args));// Print output Array object data in Args}}

The above is a piece of Java code I wrote that implements the parameter to the main method and prints it out. I'll show you how to pass the parameters to the Main method:

First step: As shown, click the drop-down triangle referred to by the Red arrow and select "Run Configurations" in the list of menu items

650) this.width=650; "Src=" http://img.blog.csdn.net/20170308203235873?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqvr09prf9dt0rfug==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Center "width=" 487 "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "title=" "style=" width:487px;height:70px; "alt=" Center "/>


Step Two: Follow the steps shown, and then run the program to see the results

650) this.width=650; "Src=" http://img.blog.csdn.net/20170308203659129?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqvr09prf9dt0rfug==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Center "alt=" center "/>


Step Three: View the print results in the console and find the parameters passed in as an array in the second step

650) this.width=650; "Src=" http://img.blog.csdn.net/20170308201425176?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqvr09prf9dt0rfug==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Center "alt=" center "/>


Note: I am using the Eclipse version: Juno Service Release 2, the steps may vary slightly depending on the version of the software being used.

This article is from the "Shan Haibo blog" blog, make sure to keep this source http://hhb96.blog.51cto.com/8222007/1918266

How eclipse passes arguments to the main method

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.