Answered step by step
Verified Expert Solution
Link Copied!

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 ""?

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

Students also viewed these Databases questions