A good answer might be:

There is nothing wrong with the program. Since color is a primitive data type, an expression such as

color == 'V'
compares the contents of color (a character) to the character literal 'V'. However, the following would be wrong:
color == "V"
This is asking to compare the character value in color with a reference to the String object "V".

End of the Chapter

That is the end of this chapter. A strong case can be made for reviewing the following subjects. Click on a blue subject that interests you to go to where it was discussed. To get back here, click on the "back arrow" button of your browser.

The next chapter will discuss the do statement.


Click here to go back to the main menu.
You have reached the End.