在Java 中宣告多個相同值的變數
問題:
問題:String one = "", two = "", three = "" etc...
String one, two, three = ""
是否有一種簡潔有效的方法來同時初始化多個變量,例如:
答案:String one, two, three; one = two = three = "";
Person firstPerson = new Person(); Person secondPerson = new Person(); Person thirdPerson = new Person();
以上是如何簡潔地初始化相同值的多個Java變數?的詳細內容。更多資訊請關注PHP中文網其他相關文章!