Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 GGCStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started