The Java Program: 7-library-puzzlers/puzzle-60/OneLiners.java
1 import java.util.*;
2
3 public class OneLiners {
4 public static void main(String[] args) {
5
6 String[] breakfast = { "spam", "sausage", "spam", "spam", "bacon",
7 "spam", "tomato", "spam" };
8 System.out.println(withoutDuplicates(Arrays.asList(breakfast)));
9
10
11 String weaponry = "fear, surprise,ruthless efficiency, an almost " +
12 "fanatical devotion to the Pope, nice red uniforms";
13 System.out.println(Arrays.asList(parse(weaponry)));
14
15
16 int[][] magic = {{6, 7, 2}, {1, 5, 9}, {8, 3, 4}};
17 System.out.println(arrayToString(magic));
18
19
20 System.out.println(hasMoreBitsSet(0x0f0f0f0f, 0x88888888));
21 System.out.println(hasMoreBitsSet(0x88888888, 0x0f0f0f0f));
22 }
23
24
25 static <E> List<E> withoutDuplicates(List<E> original) {
26
27 }
28
29
30 static String[] parse(String string) {
31
32 }
33
34
35 static String arrayToString(Object[] array) {
36
37 }
38
39
40 static boolean hasMoreBitsSet(int i, int j) {
41
42 }
43 }