1. 이건 코틀린
class Person {

var name: String = "" // mutable 프로퍼티, getter와 setter 자동 생성

val age: Int = 0 // immutable 프로퍼티, getter 자동 생성

}

2. 이건 씨샵

public class Person

{

public string Name { get; set; } // Auto-implemented 프로퍼티

public int Age { get; } // 읽기 전용 Auto-implemented 프로퍼티

}

3. 이건 자바 + 롬복(그냥 자바는 비교할 가치도 없으니 생략)

import lombok.Getter;

import lombok.Setter;


@Getter @Setter

public class Person {

private String name; // mutable 프로퍼티, getter와 setter 자동 생성

private final int age; // immutable 프로퍼티, getter 자동 생성

}