What is the difference between “instantiated” and “initialized”?

后端 未结 11 2276
青春惊慌失措
青春惊慌失措 2020-11-30 17:02

I\'ve been hearing these two words used in Microsoft tutorials for VB.NET. What is the difference between these two words when used in reference to variables?

11条回答
  •  清歌不尽
    2020-11-30 17:48

    See the Java docs: https://docs.oracle.com/javase/tutorial/java/javaOO/objectcreation.html

    "Point originOne = new Point(23, 94);

    Declaration: The code set in bold are all variable declarations that associate a variable name with an object type.
    Instantiation: The new keyword is a Java operator that creates the object.
    Initialization: The new operator is followed by a call to a constructor, which initializes the new object."
    

提交回复
热议问题