Quick Index

Objectives



Steps



Problem Statement


Concept


DataNode is a fundamental data structures model type. It is simply a node that holds data (has an instance variable "data").

DataNode is a simple key-value object:

DataNode
	data

The instance variable (ivar) is "data".

Coding requirements:







































































































Hints


You only need one ivar, one constructor, and one instance method for the DataNode class





































































































Solution


Here is code with explanations





































































































Test Code


Testing Problem Statement


Also reference the Association test write-up as needed.

Write code to test the model. If you get stumped, look at test code solution.

Test Code Solution


First, try to write test code yourself. Then review and compare the following for possible ideas.


Here is support code that is needed for the test code.

Note that this support code is just one example of a minimal testing framework. Feel free to build your own.