Constructor is static or non static

后端 未结 11 1561
青春惊慌失措
青春惊慌失措 2021-02-04 12:33

As per standard book constructor is a special type of function which is used to initialize objects.As constructor is defined as a function and inside class function can have on

11条回答
  •  既然无缘
    2021-02-04 13:09

    The new operator returns a reference to the object it created.

    new Test(); // creates an instance.
    

    The System.out.println(this); is called after the new operator has instantiated the object

提交回复
热议问题