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.util.Scanner;
2public class exercise30 {
3public static void main( String[] args ) {
4Scanner keyboard = new Scanner(System.in);
5int total = 0;
6boolean current;«
7System.out.print("Type in a bunch of values and I'll add them up. ");
8System.out.println("I'll stop when you type a zero.");
9while (total += current){
10System.out.print("Value: ");
11current = keyboard.nextInt();
12
13System.out.println("The total so far is: " + total);
14} while ( current != 0 );
15System.out.println("The final total is: " + total);
16} }