You are viewing a single comment's thread. Return to all comments →
import java.io.*; import java.util.Scanner; class Solution{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); String a= sc.next(); String b = sc.next(); int c = a.length(); int d = a.length(); System.out.println(c+d); if(a.compareTo(b)>0){ System.out.println("yes"); } else{ System.out.println("No"); } String str1 = Character.toUpperCase(a.charAt(0)) + a.substring(1); String str2 = Character.toUpperCase(b.charAt(0))+b.substring(1); System.out.println(str1 + " " + str2);
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 →
import java.io.*; import java.util.Scanner; class Solution{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); String a= sc.next(); String b = sc.next(); int c = a.length(); int d = a.length(); System.out.println(c+d); if(a.compareTo(b)>0){ System.out.println("yes"); } else{ System.out.println("No"); } String str1 = Character.toUpperCase(a.charAt(0)) + a.substring(1); String str2 = Character.toUpperCase(b.charAt(0))+b.substring(1); System.out.println(str1 + " " + str2);