java create new object in constructor code example Example 1: java create new object Car mycar = new Car(); Example 2: create instance object java myCar = new Car();