





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






class Test { }
int z = 23; int x = 7, y = 53; x *= y; y /= 2; x++; z += (x + y);
boolean q = true, r = false, s = true, result;
int x = 5, y = 9, z = 2; boolean r = false, result;
double xx = 32; while (xx > 1.0); xx /= 2; System.out.println("xx = " + xx); int i = 10; int j = 4; int k = i / j; double x = i / j; double y = (1.0 * i) / (1.0 * j); System.out.println("k = " + k + ", x = " + x + ", y = " + y); } }
public static boolean isPrime(int number)
public static double isFun(int number)
public static int someMethod(boolean myNum, double yourNum)
public static void mYmEtHoD(int nUmBer; boolean sToP) { ... }
public static void anotherMethod() { ... }
anotherMethod(anotherMethod());
public static void oneMethod(double x) { …} public static int anotherMethod() { return 10 }
oneMethod(anotherMethod());
public static void oneMethod(int x) { …} public static double anotherMethod() { return 10.0 }
oneMethod(anotherMethod());
{ int i = 4; for (i = 2; i < 9; i++) System.out.println(i); System.out.println(a) System.out.println(i); public static workerAntScope() { System.out.println(i); } public static void main() { beatleScope(); antScope(); workerAntScope(); } }
public static void Unknown(double x, double y) { x = x + y; y = x + y; } public static int Mystery(int x, int y) { x = x + y; y = x + y; return (x + y); }
double x = 1.0; double y = 2.0; Unknown(y, x); System.out.println("x = " + x + ", y = " + y); i = 3; j = 4; j = Mystery(i, j); System.out.println("i = " + i + ", j = " + j);
public class FlavoredScope { public static int x = 4; public static int y = 8; public static int z = 2; public static void mints(int x, int z, int y) { winterfresh(y,z); x = pepermint(y); System.out.println(x); System.out.println(y); System.out.println(z); } public static void winterfresh(int x, int y) { int z = -1; x = y + z; } public static int peppermint(int y) { y *= z; return y; } public static int cherry(int y, int z, int x) { x = y; y = z ; z *= y; return z; } public static void main( String args[ ] )
{ mints(z, y, cherry(x, y, z)); System.out.println(x); System.out.println(y); System.out.println(z); } }
int A[] = new int[10]; A[0] = 1; A[1] = 2; for (int i = 2; i < A.length; i++) { if ((i % 2) == 1) A[i] = A[i-1] + A[i-2]; else A[i] = 2 * A[i-1]; }
public static int mystery(int a[]) { int answer = 0;