This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: / // // f) Increase the age of person1 by 2. Hint: Use getAge to obtain the age // then use setAge to set the new age. // / // g) Display the current age of person1. / // h) Set the age of person2 to -12. / // i) Display the age of person2. / // j) Display a message that indicates whether or not person1 has the same name as person2. s // k) Display a message that indicates whether or not person1 is younger than person2, // older than person2 or they have the same age. / // l) Create a Person object whose name is "Marcus Brown" and age 25 and assign it // to the class type variable person3. / // m) Use the method setName to assign the name "Marcus Smith" to the Person object referred via person3. P // n) Display a message indicating whether person3 is equal to person1. / // o) Use the method setName to set the name of person3 to null. / person3.setName(null); p // p) Display the name of person3. / } }...
View Full Document
This note was uploaded on 11/15/2010 for the course CSCI 01209 taught by Professor Storm during the Fall '10 term at University of Georgia Athens.
- Fall '10