Asked by Jake
0
down vote
favorite
I have to print:
Ain't no sunshine when she's gone It's not warm when she's away. Ain't no sunshine when she's gone And she's always gone too long Anytime she goes away.
How would I used methods to print these no loops?
Would it be something like this:
public class AintNoSunshine {
public static void main (String[] args)
{
String string1 =(" Ain't no sunshine when she's gone! " );
System.out.println( string1);
String string2 = " It's not warm when she's away. ";
System.out.println( string2);
String string3 = " And she's always gone too long ";
System.out.println( string3);
String string4 = " Anytime she goes away. ";
System.out.println( string4);
}
}
Thank you.
down vote
favorite
I have to print:
Ain't no sunshine when she's gone It's not warm when she's away. Ain't no sunshine when she's gone And she's always gone too long Anytime she goes away.
How would I used methods to print these no loops?
Would it be something like this:
public class AintNoSunshine {
public static void main (String[] args)
{
String string1 =(" Ain't no sunshine when she's gone! " );
System.out.println( string1);
String string2 = " It's not warm when she's away. ";
System.out.println( string2);
String string3 = " And she's always gone too long ";
System.out.println( string3);
String string4 = " Anytime she goes away. ";
System.out.println( string4);
}
}
Thank you.
Answers
There are no human answers yet.
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.