import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone {

	public static void main (String[] args) throws java.lang.Exception {
		
		Person youngest;
		
		// you could do string comparison if you know the timezones are consistent:
		
		youngest = listOfPersons.stream()
		    .max(Comparator.comparing(p -> p.dateOfBirth)).get();
		
		System.out.println("youngest is: " + youngest.name + " " + youngest.dateOfBirth);

        // or you could just parse the date, a safer option:
		
		youngest = listOfPersons.stream()
		    .max(Comparator.comparing(p -> LocalDateTime.parse(p.dateOfBirth))).get();
		
		System.out.println("youngest is: " + youngest.name + " " + youngest.dateOfBirth);
		
	}

	
	//------------------------------------
	// types from OP:
	
	static class Person{
		String name;
		String id;
		String dateOfBirth;
		int salary;
	}

	static List <Person> listOfPersons;

	
	//------------------------------------
	// boring example data initialization:
	
	// make an iso birthdate string given an age (for initializing data)
	static String fromAge (int years) {
		return LocalDateTime.now().minusYears(years).toString(); // ISO8601
	}
	
	// make up some data
	static {
		listOfPersons = List.of(
			// fine for example, but i wouldn't init like this in production
			new Person() {{ name="helga"; dateOfBirth=fromAge(22); }},
			new Person() {{ name="mortimer"; dateOfBirth=fromAge(48); }},
			new Person() {{ name="gertrude"; dateOfBirth=fromAge(6); }},
			new Person() {{ name="jebediah"; dateOfBirth=fromAge(39); }}
		);
		listOfPersons.forEach(p -> System.out.println(p.name + ' ' + p.dateOfBirth));
	}

	
}