<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE251%3ASession4ShortQuestions</id>
	<title>SE251:Session4ShortQuestions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE251%3ASession4ShortQuestions"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE251:Session4ShortQuestions&amp;action=history"/>
	<updated>2026-04-29T21:28:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE251:Session4ShortQuestions&amp;diff=9417&amp;oldid=prev</id>
		<title>Mark: 1 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE251:Session4ShortQuestions&amp;diff=9417&amp;oldid=prev"/>
		<updated>2008-11-03T05:20:55Z</updated>

		<summary type="html">&lt;p&gt;1 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Session 4 Short Answer Questions ==&lt;br /&gt;
&lt;br /&gt;
1. Under what circumstances would a call to Iterator.next() throw a NoSuchElementException?&lt;br /&gt;
&lt;br /&gt;
2. Is this valid:&lt;br /&gt;
 List&amp;lt;String&amp;gt; list = new List&amp;lt;String&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
3. Is this valid:&lt;br /&gt;
 LinkedList&amp;lt;List&amp;gt; list = new LinkedList&amp;lt;List&amp;gt;();&lt;br /&gt;
&lt;br /&gt;
4. What will be the output:&lt;br /&gt;
 Vector&amp;lt;String&amp;gt; list = new Vector&amp;lt;String&amp;gt;();&lt;br /&gt;
 list.add(&amp;quot;hello&amp;quot;);&lt;br /&gt;
 Iterator&amp;lt;String&amp;gt; i = list.iterator();&lt;br /&gt;
 System.out.println(i);&lt;br /&gt;
&lt;br /&gt;
5. Is this valid:&lt;br /&gt;
 Vector&amp;lt;String&amp;gt; list = new Vector&amp;lt;String&amp;gt;();&lt;br /&gt;
 list.add(&amp;quot;hello&amp;quot;);&lt;br /&gt;
 Iterator i = list.iterator();&lt;br /&gt;
 String str = i.next();&lt;br /&gt;
&lt;br /&gt;
6. What will be the output?&lt;br /&gt;
 Vector&amp;lt;String&amp;gt; list = new Vector&amp;lt;String&amp;gt;();&lt;br /&gt;
 list.add(&amp;quot;one&amp;quot;);&lt;br /&gt;
 list.add(&amp;quot;two&amp;quot;);&lt;br /&gt;
 Iterator&amp;lt;String&amp;gt; i = list.iterator();&lt;br /&gt;
 System.out.println(i.next());&lt;br /&gt;
&lt;br /&gt;
7. What will be the output?&lt;br /&gt;
 TreeSet&amp;lt;String&amp;gt; list = new TreeSet&amp;lt;String&amp;gt;();&lt;br /&gt;
 list.add(&amp;quot;Pig&amp;quot;);&lt;br /&gt;
 list.add(&amp;quot;Albatross&amp;quot;);&lt;br /&gt;
 list.add(&amp;quot;Unicorn&amp;quot;);&lt;br /&gt;
 Iterator i = list.iterator();&lt;br /&gt;
 System.out.println(i.next());&lt;br /&gt;
&lt;br /&gt;
8. Which of the following lines are valid:&lt;br /&gt;
 Queue queue = new LinkedList();&lt;br /&gt;
 List list = new LinkedList();&lt;br /&gt;
&lt;br /&gt;
9. HashMap does not implement Iterable, and neither do its superclasses. Nevertheless it is possible to obtain an iterator for the entries of a HashMap. How?&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>