什么是string [] args的意思 [英] what is string[] args means

查看:188
本文介绍了什么是string [] args的意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public static void main(String [] args)



以下是关于上述代码的问题 -



1)在上面的代码中是什么意思字符串。



2)在上面的代码中是什么意思[]。



3)在上面的代码中是什么意思args。



4)如果我不包含String [] args。

public static void main(String[] args)

following are my questions about above code -

1) in above code what is meaning of "String".

2) in above code what is meaning of "[]".

3) in above code what is meaning of "args".

4) what if i do not include "String[] args".

推荐答案

请参阅: https://en.wikipedia.org/wiki/Entry_point#Java [ ^ ]。



任意问题?



-SA


1)字符串:字符的列表。 这是一个字符串。 这就是这个

2)[]:数组。数组是一种特定类型的集合,就像一个棋盘,每个正方形一次可以容纳一个。



所以String []是一个字符串数组。



3)args:接收字符串数组的变量的名称。



在这种情况下,它获取在执行时传递给应用程序的任何参数 - 例如输入和输出文件名。



4)你不会能够使用任何应该用来控制你的程序如何工作的参数。



这是相对简单的东西 - 但是后来你的意思是有意义的课程。现在忽略它,你的导师会解释一个阵列比我更好!
1) String : A "list" of characters. "This is a string". "So is this"
2) [] : Array. An array is a specific type of collection, like a chess board where each "square" can hold one piece at a time.

So "String[]" is an array of strings.

3) args : name of the variable that receives the array of strings.

In this case, it gets any parameters that were passed to the application when it was executed - input and output file names for example.

4) You won't be able to use any parameters that were supposed to be used to control how your program works.

This is relatively simple stuff - but it'll make sense later in your course. Ignore it for now, and your tutor will explain what an array is better than I could!


转到http://download.oracle.com/javase/tutorial/index.html [ ^ ]并研究。


这篇关于什么是string [] args的意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆