Skip to content

Commit c04eec0

Browse files
authored
Create Person.java
1 parent a3343ed commit c04eec0

File tree

1 file changed

+23
-0
lines changed
  • lombok-modules/lombok/src/main/java/com/baeldung/lombok/intro

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import lombok.Getter;
2+
import lombok.experimental.FieldNameConstants;
3+
4+
@Getter
5+
@FieldNameConstants
6+
public class Person {
7+
8+
private final String firstName;
9+
private final String lastName;
10+
private final int age;
11+
12+
public Person(String firstName, String lastName, int age) {
13+
this.firstName = firstName;
14+
this.lastName = lastName;
15+
this.age = age;
16+
}
17+
18+
public static void main(String[] args) {
19+
System.out.println(Person.Fields.firstName);
20+
System.out.println(Person.Fields.lastName);
21+
System.out.println(Person.Fields.age);
22+
}
23+
}

0 commit comments

Comments
 (0)