java struct

Solutions on MaxInterview for java struct by the best coders in the world

showing results for - "java struct"
Lisa
28 May 2018
1Java 14 has added support for Records, which are structured data types that are very easy to build.
2
3You can declare a Java record like this:
4
5public record AuditInfo(
6    LocalDateTime createdOn,
7    String createdBy,
8    LocalDateTime updatedOn,
9    String updatedBy
10) {}
11 
12public record PostInfo(
13    Long id,
14    String title,
15    AuditInfo auditInfo
16) {}