Quick Index
Two Methods With the Same Name?




The challenge specifies that you code two "set" methods. Two methods using the same name. Is that possible?

Yes it is, it is a nice feature available in Java, and is called method overloading

Method Headers Must Be Precise



If a spec (challenge writeup) states that you need to code a method with this header:

public void setX(int aValue)

Then the method header you code should match that specified header exactly.

These are all incorrect:

public void setX(int value1, int value2)		//INCORRECT HEADER -> two parameters, one specified"
public void SetX(int value)		//INCORRECT HEADER -> SetX should be setX"
public void setX1(int value)	//INCORRECT HEADER -> setX1` should be setX"

Testing (Follow the Pattern)


Follow the code pattern shown in this example (RectangleTests).... You will be coding PointTests so rather than testing "Rectangle" objects (like the example does) you will test Point objects.

Your New Test Methods


The challenge says to [The challenge is to write a test method for each of the new "Point" methods described in the previous section].

That means you will have four new test methods such as the following four:


NOTE -- the challenge does not specify test method names which means it is "coder's choice". This is unlike the methods we add to Point, where the method headers are specified for us so we must match those exactly.