Question: 2 . 1 1 . 2 : Print two strings in alphabetical order. Print the two strings, firstString and secondString , in alphabetical order. Assume

2.11.2: Print two strings in alphabetical order.
Print the two strings, firstString and secondString, in alphabetical order. Assume the strings are lowercase. End with newline.
Sample output:
capes rabbits
Learn how our autograder works
546242.2877792.qx3zqy7
secondString = scnr. next();
firstString="rabbits";
secondString="capes";
if (firstString.compareTo(secondString)0)
{
System.out.println(firstString +""+ secondString);
}
else
{
System.out.println(secondString +""+ firstString);
}
23
243
25
Not all tests passed
Testing input rabbits capes
Your output
Testing input capes rabbits
Your output
x Testing input clearly clear
Output differs. See highlights below.
Your output
Expected output
x Testing input wand wand
Output differs. See highlights below.
Your output
Expected output
 2.11.2: Print two strings in alphabetical order. Print the two strings,

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!