



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Parts of this handout by Eric Roberts and Patrick Young
public boolean IsNameQ() { String name = readLine("Enter name: "); return (name == "Q"); }
public boolean IsNameQ() { String name = readLine("Enter name: "); char ch = name.charAt(0); return ((ch == 'Q') && (name.length() == 1)); }
ExpandableArray myList = new ExpandableArray(); myList.set(14, "Bob"); myList.set(21, "Sally");
String value = (String) myList.get(14); // Note the cast if (value != null) { println("Got value: " + value); }
Parts of this handout by Eric Roberts and Patrick Young
(name == "Q")
name.equals("Q")
(ch == 'Q')