John Sanderval wrote:. . . I would guess this is a runtime error . . .
Do you mean the first of the lines you mentioned,
var1.two()?
Don't guess. If you spent half the time reading the code you were given that you have spent complaining, you could have seen how many
two() methods there are in the declared type of
var1. You could also have worked out whether there is anything in the
two() method that could cause an exception to be thrown. You don't even have a cast in that line to make things more difficult. Calling the classes after colours and calling the methods
one(),
two(), and
three() doesn't make it any easier, unfortunately.