本文介紹了從技術上講,您可以在 main 方法中調用 string[] 嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
限時送ChatGPT賬號..
main
方法的標頭是
public static void main (String[] args)
你能用你想要的任何東西在技術上替換args"嗎?還有,為什么參數是數組?
Could you technically replace "args" with anything you want? Also, why is the parameter an array?
推薦答案
args
只是方法中參數的名稱.您可以將其重命名為您想要的任何名稱.JVM 不需要知道參數是什么命名;只有 type,String[]
,是重要的.
args
is just a name for the argument in a method. You can rename it to whatever you want. The JVM doesn't need to know what the argument is named; only the type, String[]
, is important.
不要破壞應用程序的起點
dont break the start point of the app
static void main(String[] whateverYouNeed)
這篇關于從技術上講,您可以在 main 方法中調用 string[] 嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!