Skip to main content
0 online
theremin May 3, 2006

Quite a lot to do with this one.. so Far I have a class that looks like public class Person { private String firstName; private String lastName; public Person() { firstName = ""...

iwz May 3, 2006

Well, here's something to get you started: "So how would I set the last name only" q[Person person = new Person(); person.setLastName("Smith");]q or q[Person person = new Person(null, "Smi...

theremin May 3, 2006

That is kind. Thank you.

iwz May 3, 2006

here's a bonus equals method you can add to the Person class: q[public boolean equals( Object o ) { if ( this == o ) return true; if ( o == null || getClass() != o.getClas...

theremin May 3, 2006

Well this is what I did.. tell me if it looks right. It compiles without errors at least. hehe public class Person { private String firstName; private String middleName; private String ...

iwz May 3, 2006

Looks pretty good. I'd change a couple of things tho. == is not proper for comparing Strings. use .equals() instead. so this q[firstName == otherPerson.firstName && lastName == otherPerson.la...

theremin thereminOG 2002

Oh, we didn't talk about a clone() method yet. Thanks for all the help as usual.

Welcome Back to eZabel

It's been a while. Here's what's new.

eZabel Lore

A complete history of our community — stats, Hall of Fame, legendary threads, and more.

View the Lore →

Everything Preserved

All 225,969 pieces of content from 2000–2014 are here — forums, messages, journals, photos, polls, and events.

💎

Gems

Spot something you love — a legendary comment, a classic thread, a great photo? Log in and click the diamond icon to mark it as a Gem. Add a note about why it's special. The best stuff surfaces on the Gems page.