1. Engineering
  2. Computer Science
  3. string thebardquotalas poor yorickquot string thesubbardthebardsubstring59 string theclichequota poor workman...

Question: string thebardquotalas poor yorickquot string thesubbardthebardsubstring59 string theclichequota poor workman...

Question details

String theBard="Alas poor Yorick";

String theSubBard=theBard.substring(5,9);

String theCliche="A poor workman blames his tools";

String theSubCliche=theCliche.substring(2,7);

String output="The result is: ";

if(theSubBard.equals(theSubCliche)) {

    output = output + " a cliched phrase!";

}

else{

    output = output + " a work of genius!";

}

System.out.println

I know the output of this is[ The result is: a work of genius]

but I don't know how it happened, could you please give me the output by each segment, thank you so much

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution