Thursday, October 27, 2011

What ‘new operator’ in java does?

Ans: i. The new operator instantiates a class by allocating memory for a new object ii. The new operator also invokes the constructor. iii. The new operator requires a single, postfix argument: a call to a constructor. iv. The name of the constructor provides the name of the class to instantiate. v. The new operator returns a reference to the object it created. vi. This reference is usually assigned to a variable of the appropriate type.  

If you could click on some of the google ads you see on the right side. It will help me to run this blog and motivates me ;)

1 comment:

  1. The new operator returns the heap memory address of the allocated instance

    Java Training

    ReplyDelete