You are viewing a single comment's thread. Return to all comments →
import java.io.*; import java.util.*; public class Solution { public static String capitalize(String str){ StringBuilder capitalize = new StringBuilder(); char firstChar = str.charAt(0); capitalize.append(Character.toTitleCase(firstChar)).append(str.substring(1)); return capitalize.toString(); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A=sc.next(); String B=sc.next(); sc.close(); System.out.println(A.length() + B.length()); if(A.charAt(0)>B.charAt(0)) System.out.println("Yes"); else System.out.println("No"); System.out.println(capitalize(A) + " " + capitalize(B)); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Strings Introduction
You are viewing a single comment's thread. Return to all comments →
Solution code :-