Q without A
- Nature's last word
- why using single quotes update variable? not double quotes?
$ export PS1='${RANDOM} $ ' $ export PS1="${RANDOM} $ "
- In svn, this is not working:
$ svn copy -r 9 file:///Users/username/myrepos/trunk/baz.c baz.c // however this is working: $ svn copy file:///Users/username/myrepos/trunk/baz.c@9 baz.c
- Why using %s to display enum type values?
// getScale() returns enum type out.printf("%5.2f degrees %s%n", getNumber(), getScale());
- Java, what's the difference between:
List<String> list = new ArrayList<String>(Arrays.asList("one", "two", "", "three")); // version 1: List<String> sub = new ArrayList<String>(list.subList(1,3)); // version 2:
// work
list.remove(sub); List<String> sub2 = list.subList(1,3);
// won't work:
list.removeAll(sub2); // why??? - why does this work:
public class Wildcards { public static void main(String[] args) { Holder<?> unbounded = new Holder<Long>(); Long lng = 1L; Object r11 = wildSubtype(unbounded, lng); // why can pass in Holder<?> to wildSubtype(Holder<? extends T> holder, T arg)? } static <T> T wildSubtype(Holder<? extends T> holder, T arg) { T t = holder.get(); return t; } } class Holder<T> { private T value; public Holder() {} public Holder(T val) { value = val; } public void set(T val) { value = val; } public T get() { return value; } }
- d
- d
- d
- d
- d
- d