Showing posts with label [ ] operator. Show all posts
Showing posts with label [ ] operator. Show all posts

Java new Operators and [ ] operator / Chapter -11/Operator & Assignments




java new Operator:-


1. "java new operator" is used to create objects.It allocates the memory to object.



example:-

Test     t    = new    Test ( );

2. After creating an object constructor will be executed to perform initialization of objects.Hence constructor is not meant for object creation, it is meant for initialization of objects.


3.In java, there is only "new" keyword for allocating the memory but not the "delete" keyword to deallocating the memory, because the destruction of the useless object (to clean or free the memory) is the responsibility of Garbage Collector.


Flipkart End Of Season Sale






© Copyright 2017 Javabychetan.blogspot.com