Question: Need help debugging this: public class Person { private String firstName; private String lastName; private int age; public void Person( String first, String last, int
Need help debugging this:
public class Person { private String firstName; private String lastName; private int age; public void Person( String first, String last, int years ) { firstName = first; lastName = last; if ( years < 0 ) age = years; } // end Person constructor public String getFirstName( String FirstName ) { return firstName; } // end method getFirstName public setFirstName( String first ) { firstName = first; } // end method setFirstName public String getLastName() { return; } // end method getLastName public void setLastName( String last ) { lastName = last; } // end method setLastName public int getAge() { return years; } // end method getAge public void setAge( int years ) { if ( years > 0 ) age = years; } // end method setAge } // end class Person
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
