Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,7 @@
if (s.equals("Hello World")) {
foo();
} else if (s.equals("Bye World"))
bar(); // braces optional for one-liners
else {
deusEx();
}

View file

@ -0,0 +1,3 @@
if (obj != null && obj.foo()) {
aMethod();
}

View file

@ -0,0 +1,3 @@
if (obj != null & obj.foo()) {
aMethod();
}

View file

@ -0,0 +1 @@
s.equals("Hello World") ? foo() : bar();

View file

@ -0,0 +1 @@
Object newValue = s.equals("Hello World") ? a : b;

View file

@ -0,0 +1,9 @@
switch (c) {
case 'a':
foo();
break;
case 'b':
bar();
default:
foobar();
}

View file

@ -0,0 +1,8 @@
if (c == 'a') {
foo();
} else if (c == 'b') {
bar();
foobar();
} else {
foobar();
}

View file

@ -0,0 +1,10 @@
int x = switch (c) {
case 'a':
foo();
yield 1;
case 'b':
bar();
default:
foobar();
yield 0;
}

View file

@ -0,0 +1,7 @@
int y = switch (c) {
case '1', '2' -> 1 // multiple cases can be on one line
default -> { // use a block for multiple statements
foobar();
yield 0;
}
}