String burns = "My love is like a red, red rose.";

	. . . . . .

     if ( burns.toLower().startsWith( "  MY LOVE".trim().toLower() ) )
       System.out.println( "Both start with the same letters." ); 
     else
       System.out.println( "Prefix fails." );

What does the above write to the monitor?

A good answer might be:

Both start with the same letters.

End of the Chapter

That was a complicated question. If you got it wrong, review the previous example. You may wish to review the following. 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 equals() method.


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