Java Reference

Java Reference Home | Smart Soft Home

new

Category

Other

Description

Used to instantiate an object. Instantiating an object does two things: 1. Creates the object in memory. 2. Invokes the object's constructor method new is only used with reference data types (objects) - not primitives.

Example

r1=new Room();