Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
if (s.equals("Hello World")) {
|
||||
foo();
|
||||
} else if (s.equals("Bye World"))
|
||||
bar(); // braces optional for one-liners
|
||||
else {
|
||||
deusEx();
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
if (obj != null && obj.foo()) {
|
||||
aMethod();
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
if (obj != null & obj.foo()) {
|
||||
aMethod();
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
s.equals("Hello World") ? foo() : bar();
|
||||
|
|
@ -0,0 +1 @@
|
|||
Object newValue = s.equals("Hello World") ? a : b;
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
switch (c) {
|
||||
case 'a':
|
||||
foo();
|
||||
break;
|
||||
case 'b':
|
||||
bar();
|
||||
default:
|
||||
foobar();
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
if (c == 'a') {
|
||||
foo();
|
||||
} else if (c == 'b') {
|
||||
bar();
|
||||
foobar();
|
||||
} else {
|
||||
foobar();
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
int x = switch (c) {
|
||||
case 'a':
|
||||
foo();
|
||||
yield 1;
|
||||
case 'b':
|
||||
bar();
|
||||
default:
|
||||
foobar();
|
||||
yield 0;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue