“Java Record” Ответ

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Java Record

// create immutable record added in jdk 14
// provides all-args constructor, getters, equals, hashcode and toString
public record Person (String name, String address) {}

// usage
Person person = new Person("John Doe", "100 Linda Ln.");

// access fields
String name = person.name();
String address = person.address();
Funny Falcon

Ответы похожие на “Java Record”

Вопросы похожие на “Java Record”

Больше похожих ответов на “Java Record” по Java

Смотреть популярные ответы по языку

Смотреть другие языки программирования