Thursday, October 27, 2011
Challenge 024
The statement in question should be inserted right before the last curly brace on the code. However, the statement in question should read Person person1 = new Person(name, "female", 2000);. She skipped the statement all together. when you aren't sure of the name, you should input the code name because in the previous section of code, it tells us that name = "unknown". The gender "female" must be inserted next because the code must be written in order (name, gender, 2000) because the public Person(String n, String g, int year). Female is also written in quotes because it is a string. Lastly, 2000 is inserted as an int value because she defines person1 as born in the year 2000. This will help Lauren define person1 without error
Subscribe to:
Post Comments (Atom)
Work towards testing your proposed solution in BlueJ:
ReplyDeletePerson person1 = new Person(name, "female", 2000)
..., using the Person class provided in the challenge itself. Once you do that, revise your solution here. Thank you.
Person person1 = new Person("unknown", "female", 2000); is the corrected code
ReplyDeleteNow we're talkin'.. 15 XPs awarded for this completion.
ReplyDelete