View Code of Problem 43

import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
         Scanner scan=new Scanner(System.in);
         String str=scan.nextLine();
          String str1="";
          for(int i=0;i<str.lenth();i++){
          	char t=str.charAt(i);
            if(t>='A'&&t<='z'){
            	str1=str1+t;
            }
          }
          
          System.out.println(str1);
         
	}
}
/*
Main.java:8: error: cannot find symbol
          for(int i=0;i<str.lenth();i++){
                           ^
  symbol:   method lenth()
  location: variable str of type String
1 error
*/

Double click to view unformatted code.


Back to problem 43