import java.util.*;

class A {

  private int val;
  private static int num;

  public A(int v) {
    val = v;
    num = v;
  }

  public String toString() {
    return "["+val+","+num+"]";
  }
}


public class finexrev {
	
	private int numerator;
	private int denominator;
	
	public finexrev(int n, int d) {
		numerator = n;
		denominator = d;
	}
	
	public boolean equals(int value) {
		if (denominator == 0)
			return false;
		return (value*denominator == numerator);
	}
	
	public static void main(String[] args) {
		
		// Question 1
		System.out.println("3 + 7 = "+3+7);
		
		// Test question 2
		int[] test = {3, 1, 6, 5};
		
		swap(test, 2, 3);
		System.out.println(test[2]+" "+test[3]);
		
		// Question 3
		char ch = 'A';
		for (int i=0; i<26; i++)
  			System.out.print((char)(ch+i));
		System.out.println();

		// Question 4		
		String a = "final";
    	String b = "exam";
    	String c = b;
    	String d; 
    	d = b.concat(a);
    	b = b.concat(b);

    	System.out.println("a = "+a);
    	System.out.println("b = "+b);
    	System.out.println("c = "+c);
    	System.out.println("d = "+d);
    	
    	// Question 5
    	finexrev f1 = new finexrev(13,6);
    	System.out.println(f1.equals(2));
    	finexrev f2 = new finexrev(48,6);
    	System.out.println(f2.equals(8));
    	
    	// Question 6
    	A var1 = new A(2);
    	System.out.println(var1);

    	A var2 = new A(6);
    	System.out.println(var1);
    	System.out.println(var2);
    	
    	// Question 8
    	int[] vals = new int[5];
		for (int i=0; i<vals.length; i++)
  			vals[i] = (3*i)%(vals.length);
		for (int i=0; i<vals.length; i++)
  			vals[i] = vals[vals[i]];
		for (int i=0; i<vals.length; i++)
  			System.out.print(vals[i]);
		System.out.println();
		
		/*
		// Question 9
		final int[] array = { 20, 30, 40 };
		array[0] = 50;
		int[] otherarray = new int[2];
		otherarray[0] = 3; otherarray[1] = 5;
		array = otherarray;
		*/
		
		// Question 10
		ArrayList<String> names = new ArrayList<String>();
		
		// Question 15
		Scanner stdin = new Scanner(System.in);
		System.out.println("Enter an integer.");
		int n;
		try {
			n = stdin.nextInt();
		}
		catch (InputMismatchException e) {
			System.out.println("Sorry you entered the wrong type.");
		}

	}
	
	public static void swap(int[] vals, int i, int j) {
	
		if (i < 0 || i >= vals.length)
			return;
		if (j < 0 || j >= vals.length)
			return;
		int temp = vals[i];
		vals[i] = vals[j];
		vals[j] = temp;
	}

}