Java Strings Introduction

  • + 0 comments

    import java.io.; import java.util.;

    public class Solution {

    public static void main(String[] args) {
    
        Scanner sc=new Scanner(System.in);
        String A=sc.next();
        String B=sc.next();
        char ch1=A.charAt(0);
        int n1=(int)ch1;
    
        char ch2=B.charAt(0);
        int n2=(int)ch2;
    
        System.out.println(A.length()+B.length());
       if(n1>n2){
           System.out.println("Yes");
       }else{
           System.out.println("No");
       }
       String st1=(A.substring(0,1)).toUpperCase()+(A.substring(1)).toLowerCase();
       String st2=(B.substring(0,1)).toUpperCase()+(B.substring(1)).toLowerCase();
        System.out.println(st1+" "+st2);
    }
    

    }