And here are a few usage and style pointers.Make sure you use String.equals(String) when comparing Strings and other objects. The == and != operators test the references for equality -- not the objects to which they refer. Sometimes you do want to test for reference equality, but not usually. The above should beThe first part before the && is to make sure you don't get a NullPointerException if fname is null and the second part uses trim() in case fname is " " (a space).
Java style typically saves TitleCasing for interface and class names. Packages (impl) are usually all lowercase and methods (setFirstName) leave their first character in lowercase. Constants (you didn't use any, but e.g. EMPTY_NAME = "") use all caps with underscores separating words.
Following the standards that are almost universal will make working on a team and reading from books easier. Feel free to deviate when you have a good reason.
Welcome to JavaRanch! UNfortunately, your display name does not meet the JavaRanch Naming Policy. (If you don't want to use your own name, at least pick a name that looks real.) You can change it here.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.