Übung Testate
parent
1094628075
commit
d7836fd17c
|
@ -0,0 +1,5 @@
|
|||
package oop.record;
|
||||
|
||||
public class Person {
|
||||
String name;
|
||||
}
|
|
@ -15,15 +15,14 @@ package oop.record;
|
|||
*
|
||||
*/
|
||||
|
||||
public record Point(int x, int y) {
|
||||
public record Point(int x, int y, Person p) {
|
||||
// Kein weiterer Code erforderlich, alle notwendigen Methoden und Felder
|
||||
// werden automatisch generiert.
|
||||
|
||||
static int f = 10;
|
||||
static int f = 10;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
Point p = new Point(1,2);
|
||||
Point p = new Point(1,2,new Person());
|
||||
System.out.println(p.toString());
|
||||
System.out.println(p.f);
|
||||
System.out.println(p.x());
|
||||
|
|
|
@ -13,8 +13,11 @@ public class Main {
|
|||
arr.add(4);
|
||||
arr.add(19);
|
||||
|
||||
arr.stream()
|
||||
.forEach(i -> {System.out.println(Collectors.groupingBy(i2 -> i2).toString());
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue