<?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%3AJava_Exercise_Bank</id>
	<title>SE251:Java Exercise Bank - 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%3AJava_Exercise_Bank"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE251:Java_Exercise_Bank&amp;action=history"/>
	<updated>2026-04-04T10:53:26Z</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:Java_Exercise_Bank&amp;diff=9318&amp;oldid=prev</id>
		<title>Mark: 22 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE251:Java_Exercise_Bank&amp;diff=9318&amp;oldid=prev"/>
		<updated>2008-11-03T05:20:54Z</updated>

		<summary type="html">&lt;p&gt;22 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Welcome ==&lt;br /&gt;
The purpose of this page is to provide offline programming exercises to supplement the assignments. There has been a large volume of interest from the class in getting more hands on with Java programming. So here&amp;#039;s an attempt to address this. These exercises &amp;#039;&amp;#039;do not&amp;#039;&amp;#039; contribute to your final assessment, but you can get official help with them from the lecturers and tutors (we&amp;#039;ll try our best to help anyway :). Of course, you are strongly encouraged to discuss among yourselves on this Wiki.&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
Watch this space. I am gradually going to build this page up. Feel free to add your own suggestions as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
!Exercise&lt;br /&gt;
!Level*&lt;br /&gt;
!Summary&lt;br /&gt;
|-&lt;br /&gt;
|[[SE251Ex:Strings|String manipulation and StringBuffers]]&lt;br /&gt;
|2&lt;br /&gt;
|Explore useful String operations, including comparison, substring, regular expressions, tokenising and more. Also effeciently building Strings using StringBuffer.&lt;br /&gt;
|-&lt;br /&gt;
|[[SE251Ex:File_Reverser|Reversing file contents]]&lt;br /&gt;
|1.5&lt;br /&gt;
|Read lines from a file and print them in reverse. The file is specified through the console.&lt;br /&gt;
|-&lt;br /&gt;
|[[SE251Ex:File|A Simple File Shell]]&lt;br /&gt;
|3 (4 with optional)&lt;br /&gt;
|Create, delete and list directories and files directly through Java.&lt;br /&gt;
|-&lt;br /&gt;
|[[SE251Ex:Generic_Pair|Writing a generic &amp;#039;&amp;#039;Pair&amp;lt;E1,E2&amp;gt;&amp;#039;&amp;#039;]]&lt;br /&gt;
|2&lt;br /&gt;
|Write a generic class &amp;#039;&amp;#039;Pair&amp;#039;&amp;#039; for holding two objects of parameterisable types, e.g. Pair&amp;lt;Date,Money&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|[[SE251Ex:Chain|Writing a &amp;#039;&amp;#039;Chain&amp;lt;E&amp;gt;&amp;#039;&amp;#039; datastructure]]&lt;br /&gt;
|2.5&lt;br /&gt;
|Write a special data structure called &amp;#039;&amp;#039;Chain&amp;#039;&amp;#039;, which retains the ordering of elements (like a List) but only allows at most one instance of each element (like a Set).&lt;br /&gt;
|-&lt;br /&gt;
|[[SE251Ex:Set_Operations|Writing set operations]]&lt;br /&gt;
|2&lt;br /&gt;
|Write operations for computing the union, intersection, difference and cartesian product between two Set objects.&lt;br /&gt;
|-&lt;br /&gt;
|[[SE251Ex:MultiMap|Writing a &amp;#039;&amp;#039;MultiMap&amp;lt;K,V&amp;gt;&amp;#039;&amp;#039; datastructure]]&lt;br /&gt;
|3&lt;br /&gt;
|Write a special data structure called &amp;#039;&amp;#039;MultiMap&amp;lt;K,V&amp;gt;&amp;#039;&amp;#039;, which stores a mapping from a single key to a set of values. Useful for implementing a many-to-many relationship.&lt;br /&gt;
|-&lt;br /&gt;
|[[SE251Ex:Differencing|A simple differencing tool]]&lt;br /&gt;
|3&lt;br /&gt;
|Write a simple differencing tool that works out the difference between two files A and B each containing a list of Strings separated by line breaks.&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;Levels (1=easiest, 5=hardest) are only a rough subjective guide to how much work the exercise may involve.&lt;br /&gt;
&lt;br /&gt;
== Quick dirty guide to some quintessential Java packages/classes ==&lt;br /&gt;
* package [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/lang/package-summary.html java.lang]: [http://java.sun.com/j2se/1.5.0/docs/api/java/lang/package-summary.html alternative link - outside of UoA]:&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/lang/Object.html Object] - well, what can I say. You may find yourself overriding &amp;lt;code&amp;gt;equals()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;hashcode()&amp;lt;/code&amp;gt; &lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/lang/String.html String], [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/lang/StringBuffer.html StringBuffer] - everything relating to text&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/lang/Number.html Number] and friends (Integer, Boolean, Double, etc) - for wrapping primitive types&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/lang/Math.html Math] - mathematical functions such as squre root, log, cosine, power, max, min, etc.&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/lang/System.html System] - the almighty &amp;lt;code&amp;gt;out.println()&amp;lt;/code&amp;gt;, also &amp;lt;code&amp;gt;currentTimeMillis()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* package [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/io/package-summary.html java.io]: [http://java.sun.com/j2se/1.5.0/docs/api/java/io/package-summary.html alternative link - outside of UoA]:&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/io/File.html File] - represents files or directories in your actual file system&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/io/FileFilter.html FileFilter] - useful for listing only specific files, e.g. files ending with &amp;quot;.java&amp;quot;&lt;br /&gt;
** XXXReader, XXXWriter - many different implementations for reading from and writing to various sources&lt;br /&gt;
** XXXInputStream, XXXOutputStream - many different implementations for reading from and writing to various streams&lt;br /&gt;
&lt;br /&gt;
* package [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/package-summary.html java.util]: [http://java.sun.com/j2se/1.5.0/docs/api/java/util/package-summary.html alternative link - outside of UoA]:&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/ArrayList.html ArrayList], [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/LinkList.html LinkedList] - implementations of the [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/List.html List] data structure&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/HashSet.html HashSet], [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/TreeSet.html TreeSet] - implementations of the [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/Set.html Set] data structure&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/HashMap.html HashMap], [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/TreeMap.html TreeMap] - implementations of the [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/Map.html Map] (aka Hashtable/dictionary/etc) data structure&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/Collections.html Collections], [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/Arrays.html Arrays] - provide useful algorithms (e.g. sorting, searching, max, min) to perform over Collections and Arrays&lt;br /&gt;
** [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/util/Date.html Date] - represents time, surprise surprise&lt;br /&gt;
&lt;br /&gt;
* package [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/java/awt/package-summary.html java.awt.*] [http://java.sun.com/j2se/1.5.0/docs/api/java/awt/package-summary.html alternative link - outside of UoA]:&lt;br /&gt;
** More on this later...&lt;br /&gt;
&lt;br /&gt;
* package [http://www.cs.auckland.ac.nz/JavaCache/java1.5/api/javax/swing/package-summary.html javax.swing.*] [http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/package-summary.html alternative link - outside of UoA]:&lt;br /&gt;
** More on this later...&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>