how to create which takes a object as a method in java code example Example: java create new object Car mycar = new Car();