mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-09 14:50:04 +07:00
26 lines
562 B
Java
26 lines
562 B
Java
// "Bind constructor parameters to fields" "false"
|
|
|
|
import java.util.Collections;
|
|
import java.util.LinkedHashSet;
|
|
|
|
class Person {
|
|
String name;
|
|
int age;
|
|
|
|
Person(String name, int age) {
|
|
this.name = name;
|
|
this.age = age;
|
|
}
|
|
}
|
|
|
|
class Interesting extends Person {
|
|
private final String[] hobbies;
|
|
|
|
Interesting(String name, int age, String... <caret>hobbies) {
|
|
super(name, age);
|
|
LinkedHashSet hobbySet = new LinkedHashSet<>();
|
|
Collections.addAll(hobbySet, hobbies);
|
|
this.hobbies = hobbySet.toArray(new String[hobbySet.size()]);
|
|
}
|
|
}
|