TestHouse.java
? TestHouse.java
and yet still have
errors in House.java
.
You will need to determine what the output should be
for TestHouse.java
and also for any other collection of calls to
House.java
.
TestHouse.java
the statement:
System.out.println( "The asking price of this house:\n" + h1 +"\nis $"+h1.getPrice());actually prints the price two times. Once from the
toString
method
of h1 and once in the getPrice()
method. Is that what you wanted?
// increase the asking price of h1 by $15000but the next line of code calls a method on h2 not h1. Is that a mistake?
toString()
method which only prints out the relevant properties
of the object.