Explain JAVA code

Posted by MIW on Stack Overflow See other posts from Stack Overflow or by MIW
Published on 2010-03-20T01:45:54Z Indexed on 2010/03/20 1:51 UTC
Read the original article Hit count: 347

Filed under:
|

I need some help to explain the meaning from line 5 to line 9. Thanks

  1. String words = "Rain Rain go away";

  2. String mutation1, mutation2, mutation3, mutation4;

  3. mutation1 = words.toUpperCase();

  4. System.out.println ("** " + mutation1 + " Nursery Rhyme **");

  5. mutation1 = words.concat ("\nCome again another day");

  6. mutation2 = "Johnny Johnny wants to play";

  7. mutation3 = mutation2.replace (mutation2.charAt(5), 'i');

  8. mutation4 = mutation3.substring (7, 27);

  9. System.out.print ("\'" + mutation1 + "\n" + mutation4 + "\'\n");

10.System.out.println ("Title length: " + words.length());

© Stack Overflow or respective owner

Related posts about homework

Related posts about mutation