Lombok @ToString Annotation

A @ToString annotation provides a toString() implementation. Let’s see this:

By default, it’ll print your class name, along with each field, in order, separated by commas.

import java.time.LocalDate;public class Person {	String firstName;	String lastName;	LocalDate dateOfBirth;	@Override	public String toString() {		return "Person [firstName=" + firstName + ", lastName=" + lastName + "dateOfBirth=" + dateOfBirth + "]";	}}

Using Lombok @ToString Annotation

@ToStringpublic class PersonLombok {	String firstName;	String lastName;	LocalDate dateOfBirth;}