define an object as public in java code example Example: java create new object Car mycar = new Car();