java print object attributes code example Example: print object java System.out.println(myObject); // invokes myObject.toString()