Question
Java program help needed ! public class Person { public static void main(String[] args) { // 1. Add some attributes to the Person class that
Java program help needed !
public class Person {
public static void main(String[] args) {
// 1. Add some attributes to the Person class that store appropriate data about a person.
// 2. Add some methods that allow the attribute values to be set.
// 3. Add another method called displayDetails() that outputs all the personal details stored about a person.
// 4. Within this main() method, create a new instance of the Person class (called 'p1')
// 5. Call each of the available set methods on the 'p1' instance.
// 6. Call the displayDetails() method to confirm the set methods have worked correctly.
// Extra. Create a Scanner object, and prompt the user for each detail of a person. Use the input data to setup a person object then display the details.
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started