subject

Print the two strings in alphabetical order. Assume the strings are lowercase. End with newline. Sample output: capes rabbits import java. util. Scanner: public class OrderStrings { public static void main (String args) { String firstString: String secondString: firstString = "rabbits" secondString = "capes" /*Your solution goes here */ return: } }import java. util. Scanner;public class OrderStrings { public static void main(String[] args) { String firstString; String secondString; firstString = "rabbit"; secondString= "capes"; //String class in java provide string comparison function, use it, and get //your work done may even use brute force i. e using for loop and compare character by // character which will not good for the programming language which already have vast //predefined number of functions if(firstString. compareTo(secondString) < 0){ System. out. println(firstString + " " + secondString); } else{ System. out. println(secondString + " " + firstString); } return; }}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Business professionals of america, and future business leaders of america – phi beta lambda are both open to business students at which levels? check all that apply. elementary school middle school high school college
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
Using the list, you can select the number of photos that will appear on each slide. a. theme b. frame shape c. pictures in album d. picture layout
Answers: 1
question
Computers and Technology, 24.06.2019 17:30
List at least one thing to check for when you're checking the clarity and professionalism of a document.
Answers: 1
question
Computers and Technology, 24.06.2019 21:40
Which of these is not a type of socket? aga (alternating grid array) pga (pin grid array) spga (staggered pin grid array) lga (land grid array)
Answers: 1
You know the right answer?
Print the two strings in alphabetical order. Assume the strings are lowercase. End with newline. Sam...
Questions
question
History, 04.02.2021 05:30
question
Advanced Placement (AP), 04.02.2021 05:30
question
Mathematics, 04.02.2021 05:30
Questions on the website: 13722362