String... args VS String[] args


categories:

  • 日常記錄
    tags:
  • Java

(String ...) is an array of parameters of type String, where as String[] is a single parameter.

Now here String[] can full fill the same purpose here but (String ...) provides more readability and easiness to use.

It also provides an option that we can pass multiple array of String rather than a single one using String[].

While String[] can be passed into a method taking String... as a parameter, two String[]s cannot. There is no implicit array concatenation that takes place here

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • pyspark.sql模塊 模塊上下文 Spark SQL和DataFrames的重要類: pyspark.sql...
    mpro閱讀 9,920評論 0 13
  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc閱讀 2,995評論 0 0
  • 我身邊有很多人不喜歡談錢!覺得這樣很功利!所以回避這個話題。 這有點像很多父母不愿意給孩子談性,所以也總是回避這個...
    筆記超人莫言言閱讀 338評論 0 1
  • 在談?wù)撘徊亢秒娪暗臅r候,大家經(jīng)常會說“好感動啊,忍不住哭了”、“笑死我了,太逗了”、“那個人怎么那么壞,太氣憤了”...
    山千黛閱讀 1,183評論 7 6
  • 共讀第三天,開始檢視閱讀序言,課前復(fù)習(xí)主動閱讀方法。 這本書講什么?這本書的主題結(jié)構(gòu)是什么?如何構(gòu)成?這本書的講得...
    白色的黑熊閱讀 478評論 0 3

友情鏈接更多精彩內(nèi)容