Skip to content

The Person class is a Java program that defines a class for a person's details. It has private instance variables for the person's surname, other names, age, marital status, and gender. It also has methods to display the person's details and to change their marital status.

Notifications You must be signed in to change notification settings

PhilomenaMusili/person

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Person Class

The Person class is a Java program that defines a class for a person's details. It has private instance variables for the person's surname, other names, age, marital status, and gender. It also has methods to display the person's details and to change their marital status.

To use the Person class, create an instance of the class and pass the required parameters to the constructor. The displayDetails() method displays the person's details, while the getMarried(String spname) method changes the person's marital status to 'M' (married) and sets the surname to the spouse's surname if the person is female.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

Acknowledgments

This project was inspired by the need to have a simple Java class for managing person details. Thanks to the developers of the Java programming language for providing a powerful and flexible language for software development.

About

The Person class is a Java program that defines a class for a person's details. It has private instance variables for the person's surname, other names, age, marital status, and gender. It also has methods to display the person's details and to change their marital status.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages