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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!