Question: my code: import java.util.Scanner; public class StringManipulation { public static void method1(String s1, String s2) { if(s1.length() > s2.length()) { System.out.println( s1 + is
my code:
import java.util.Scanner;
public class StringManipulation { public static void method1(String s1, String s2) { if(s1.length() > s2.length()) { System.out.println( s1 + " is greater in length than " + s2); } else { System.out.println( s1 + " does not have greater length than " + s2); } } public static void method2(String s1, String s2) { if (s1.compareTo(s2)
How can I put s1 and s2 with ""?

YOUR CODE'S OUTPUT 1 Enter the first string value 2 Enter the second string value 3 I love is greater in length than GGC I love appears after GGC in lexicographic order 5 I love GGC THE CORRECT OUTPUT OF THE TEST CASE 1 Enter first string value 2 Enter second string value 3 "I love" is greater in length than "GGC" "I love" appears after "GGC" in lexicographic order 5 I love GGC
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
