class Test {
class Main {
public static void main(String[]
public static void main(String args[]) {
args) {
[Link](fun());
for(int i = 0; 1; i++) {
}
[Link]("Hello")
static int fun() {
;
break;
return 20; Output: 20
}
Output: Compiler Error }
}
}
}
class Test {
public static void main(String[] import [Link].*;
args) {
for(int i = 0; true; i++) {
public class SwingExample {
[Link]("Hello") public static void main(String[] args)
;
break; { JFrame frame = new JFrame("Test
}
}
Output: Hello Frame"); [Link](300, 200);
} JButton button = new JButton("Click Me");
[Link](button);
class Main {
public static void main(String [Link](e -> {
args[]) {
[Link](fun());
Int value=1;
} [Link](value);
int fun() {
return 20; Value++ });
Output: Compiler
}
[Link](true); }}
} Error
Output: 1
import [Link].*; import [Link].*;
public class SwingExample { public class CollectionExample { public static void
public static void main(String[] args) { main(String[] args) {
JFrame frame = new JFrame("Test Frame"); List<String> list = new ArrayList<>();
Output: nothing will
[Link](300, 200); [Link]("A");
appear
JButton button = new JButton("Click Me"); [Link]("B");
[Link](button); [Link]("C");
[Link](False); } } [Link]("A");
[Link](list);
}}
public class Test { Output: [B, C]
public static void main(String[] args) import [Link].*;
{ String s1 = "abc"; Output: False public class CollectionExample {
String s2 = "abc"; public static void main(String[] args) {
[Link](s1 instanceof s2); }} List<Integer> list = new ArrayList<>([Link](1, 2, 3,
4, 5));
[Link](x -> x % 3 == 0);
[Link](list); } }
Output :[1, 2, 4, 5]