1interface Foo141
2{
3 int k = 0; /* Line 3 */
4}
5public class Test141 implements Foo141
6{
7 public static void main(String args[])
8 {
9 int i;
10 Test141 test141 = new Test141();
11 i = test141.k; /* Line 11 */
12 i = Test141.k;
13 i = Foo141.k;
14 }
15}
1Repl.it Compiler: click source buttton to go to the website
2Pros: You can add files, do javafx and jswing.
1import java.io.File;
2import java.io.IOException;
3import java.util.Scanner;
4import javax.sound.sampled.*;
5
6public class Main {
7
8 public static void main(String[] args) throws UnsupportedAudioFileException, IOException, LineUnavailableException{
9
10 Scanner scanner = new Scanner(System.in);
11
12 File file = new File("Level_Up.wav");
13 AudioInputStream audioStream = AudioSystem.getAudioInputStream(file);
14 Clip clip = AudioSystem.getClip();
15 clip.open(audioStream);
16
17 String response = "";
18
19 while(!response.equals("Q")) {
20 System.out.println("P = play, S = Stop, R = Reset, Q = Quit");
21 System.out.print("Enter your choice: ");
22
23 response = scanner.next();
24 response = response.toUpperCase();
25
26 switch(response) {
27 case ("P"): clip.start();
28 break;
29 case ("S"): clip.stop();
30 break;
31 case ("R"): clip.setMicrosecondPosition(0);
32 break;
33 case ("Q"): clip.close();
34 break;
35 default: System.out.println("Not a valid response");
36 }
37 }
38 System.out.println("Byeeee!");
39 }
40}
1import java.util.Scanner;
2 public class Main
3 {
4 public static void main (String[] args)
5 {
6 Scanner in = new Scanner (System.in);
7 System.out.prinrln("hallo");
8 drawline();
9 public static void drawline()
10 {
11 for(int i=0;i<=10;i++)
12 {
13 System.out.prinrln('*');
14 }
15 System.out.prinrln();
16 }
17 }
18 }