-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerson.java
More file actions
47 lines (43 loc) · 1012 Bytes
/
Person.java
File metadata and controls
47 lines (43 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.company;
/**
* a person who votes
*/
public class Person {
//voters first name
private String firstName;
// voters last name
private String lastName;
/**
* initialize firstname and lastname
* @param firstName voters firstname
* @param lastName voters lastname
*/
public Person(String firstName, String lastName){
this.firstName = firstName;
this.lastName = lastName;
}
/**
* a getter method returns voters firstname
* @return voters firstname
*/
public String getFirstName() {
return firstName;
}
/**
* a getter method returns voters lastname
* @return voters lastname
*/
public String getLastName() {
return lastName;
}
/**
*
* @return voters name
*/
public String toString() {
return "Person{" +
"firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
'}';
}
}