Commit 3eb3c839 authored by uiekn's avatar uiekn

Add two test cases based on meeting slides

parent 03e21568
class A {
public int i;
public static void main(String[] args) {
A a = new A();
a.i = 0;
System.out.println(a.effect(a).i);
int[] arr = new int[42];
arr[arr[0] = 10] = 42;
System.out.println(arr[0]);
System.out.println(arr[10]);
int x;
arr[x = 11] = x;
System.out.println(arr[11]);
a.effect(a.effect(a.effect(a)));
}
public A effect(A a) {
System.out.println(a.i);
A result = new A();
result.i = a.i + 1;;
return result;
}
}
class IntMin {
public static void main(String[] args) {
System.out.println(1 / 2);
System.out.println(6 / 3);
System.out.println(-6 / 3);
System.out.println(6 / -3);
System.out.println(-6 / -3);
System.out.println(-2147483648 * -1);
System.out.println(-2147483648 / -1);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment