how to declare a string inside an object java code example Example: create instance object java myCar = new Car();