PROGRAMMING:Jmu-java-03 object oriented foundation-01-constructor and toString
Define a person class, which contains attributes:
`String name ','int age','boolean gender ','int ID'. All variables must be private ('private ').
**Note: please follow the above order strictly.
###1. Write a parameterless constructor
-Print "this is constructor".
-Output name, age, gender and ID in the format of 'name, age, gender and ID'
###2. Write parametric constructors
Assign values to 'name, age and gender' in turn.
###3. Override toString function:
According to the format:'class name [name =, age =, gender =, ID] '. Eclipse is recommended for automatic generation
###4. Generate setter / getter methods for each attribute
###5. In the main method
-First, read n from the screen, which represents the number of objects to be created.
-Then enter n lines of name age gender and call the parameterized constructor written in 2 above to create a new object.
-Then output all the objects created just now in reverse order.
-Next, create a new person object with the nonparametric constructor and print the object directly.
###Input example:
```in
three
a 11 false
b 12 true
c 10 false
```
###Output example:
```out
Person [name=c, age=10, gender=false, id=0]
Person [name=b, age=12, gender=true, id=0]
Person [name=a, age=11, gender=false, id=0]
This is constructor
null,0,false,0
Person [name=null, age=0, gender=false, id=0]
```
answer:If there is no answer, please comment
`String name ','int age','boolean gender ','int ID'. All variables must be private ('private ').
**Note: please follow the above order strictly.
###1. Write a parameterless constructor
-Print "this is constructor".
-Output name, age, gender and ID in the format of 'name, age, gender and ID'
###2. Write parametric constructors
Assign values to 'name, age and gender' in turn.
###3. Override toString function:
According to the format:'class name [name =, age =, gender =, ID] '. Eclipse is recommended for automatic generation
###4. Generate setter / getter methods for each attribute
###5. In the main method
-First, read n from the screen, which represents the number of objects to be created.
-Then enter n lines of name age gender and call the parameterized constructor written in 2 above to create a new object.
-Then output all the objects created just now in reverse order.
-Next, create a new person object with the nonparametric constructor and print the object directly.
###Input example:
```in
three
a 11 false
b 12 true
c 10 false
```
###Output example:
```out
Person [name=c, age=10, gender=false, id=0]
Person [name=b, age=12, gender=true, id=0]
Person [name=a, age=11, gender=false, id=0]
This is constructor
null,0,false,0
Person [name=null, age=0, gender=false, id=0]
```
answer:If there is no answer, please comment