import java.util.Scanner;

class Oct20 {
	public static void main(String ... args) {

		Scanner kb = new Scanner(System.in);

		/* do-while

		do {
			// some code


		} while(bool_expr);

		while(bool_expr) {
			// some code

		}
		*/

		do {
			System.out.println("1. do this");
			System.out.println("2. exit");
			int command = kb.nextInt();

			if (command == 1) {
				do_this();
			}

		}while(command != 2);

		// ?:

		int x = kb.nextInt();
		int y = 0;
 
		if (x % 2 == 0) {
			y = 2;
		}
		else {
			y = 5;
		}

		int x = kb.nextInt();
		int y = (x % 2 == 0) ? 2 : 5;

		// methods

		int z = timesTwo(5);
		int w = timesTwo(y);

		// varargs

		int[] arr = {3,4,2,1};
		int sum = sum(arr);

		sum = sum(x,y);
		sum = sum(x,y,z,w);

		// Print strings with space between them 
	
		String fname = ...
		String lname = ...

		System.out.printf("%s %s\n", fname, lname);
		System.out.println(fname + " " + lname);

		// String to int or Integer

		String str = "100";
		int i = Integer.parseInt(str);
		Integer ii = Integer.valueOf(str);

	}

	static int timesTwo(int x) {
		int y = x * 2;
		return y;
	}

	// count number of times k is in array
	static int numInstances(int[] arr, int k) {
		int counter = 0;
		for(int elm : arr) {
			if (elm == k) {
				counter++;
			}
		}
		return counter;
	}

	static int numInstances(String word, char c) {
		int counter = 0;
		char[] arr = word.toCharArray();
		for(char elm : arr) {
			if (elm == c) {
				counter++;
			}
		}
		return counter;
	}

	static int sum(int[] values) {
		int sum = 0;
		for(int x : values) {
			sum += x;
		}
		return sum;
	}

	static int sum(int ... values) {
		int sum = 0;
		for(int x : values) {
			sum += x;
		}
		return sum;
	}

}

// end of file
