What does the `new` keyword do

后端 未结 9 1892
情深已故
情深已故 2020-12-01 09:41

I\'m following a Java tutorial online, trying to learn the language, and it\'s bouncing between two semantics for using arrays.

long results[] = new long[3]         


        
9条回答
  •  爱一瞬间的悲伤
    2020-12-01 10:12

    The both are same. The second option is doing implicit creation of array object, it is just for user convenience.

提交回复
热议问题