String h = "Hello"; String w = "world"; String n = "My name is Pam."; Sting hw = h+w;
System.out.println(hw) look like?
System.out.println(n.substring(0,4)) look like?
h.matches("hello") evaluate
to?
true?
n to get another string
containing just Pam's name?
addAtEnd(T element)
getElement(int index) //returns element without
altering list.
hasNext and
next will not be called recursively. How does the code in the
textbook overcome this difficulty?
TreeMap<Integer, String> m = new
TreeMap<Integer, String>();
m.put(new Integer(12345),"John");
m.put(new Integer(23456),"Sue");
m.put(new Integer(12543),"Adam");
m.put(new Integer(32145),"Nathan");
m.put(new Integer(14352),"Kay");
Set<Entry<Integer, String>> pairs = m.entrySet();
Iterator<Entry<Integer, String>> itr = pairs.iterator();
while (itr.hasNext())
System.out.println(itr.next());