Question: Given string strinput1 on one line and string strInput2 on a second line, assign outputStr with the shorter string. If the strings are the same
Given string strinput1 on one line and string strInput2 on a second line, assign outputStr with the shorter string. If the strings are the same length, assign outputStr with "Same length". Ex: If the input is: park orange then the output is: park 1 import java. util. Scanner; public class StringSize { OUSWN public static void main(String args) { Scanner sonr = new Scanner (System. in) ; String strInput1; String strInput2; String outputstr; 9 19 strInput1 = scor . nextLine(); 11 strInput2 = scor . nextLine(); 12 13 /* Your code goes here */ 14 15 System. out. printIn(outputStr); 16 17 }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
