Java snippets02

			if (Character.isLowerCase(ch[i])) {
				char temp = Character.toUpperCase(ch[i]);
				ch[i] = temp;
			} else if (Character.isUpperCase(ch[i])) {
				char temp = Character.toLowerCase(ch[i]);
				ch[i] = temp;
			}

			while (true) {
				flag = 0;
				result = tc.getNum();

				input = Integer.parseInt(br.readLine());

				while (flag == 0) {
					if (input == result) {
						System.out.println("very good!");
						flag = 1;
					} else {
						flag = 0;
						System.out.println("no,please try again.");
						input = Integer.parseInt(br.readLine());
					}
				}
			}

		L1: while (true) {
			int question = new Times().question();
			L2: while (true) {
				int answer = scanner.nextInt();
				if (answer == question) {
					System.out.println("very good!");
					continue L1;
				} else {
					System.out.println("no,please try again.");
					continue L2;
				}
			}
		}

char[] c1 = s1.toCharArray();

		Map<Integer, String> m = new HashMap<Integer, String>();
		m.put(1, "one");
		m.put(2, "two");
		m.put(3, "three");
		Object o[] = m.values().toArray();

GregorianCalendar ca = new GregorianCalendar();
System.out.println(ca.get(GregorianCalendar.AM_PM));

你可能感兴趣的:(java)