Finding all uppercase letters of a string in java

前端 未结 10 1063
后悔当初
后悔当初 2021-01-12 14:28

So I\'m trying to find all the uppercase letters in a string put in by the user but I keep getting this runtime error:

Exception in thread \"main\" java.lan         


        
10条回答
  •  心在旅途
    2021-01-12 15:23

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("Enter the number");
        String str= input.nextLine();
    
        int ascii;
        for(int i=0; i= 65 && ascii <= 90) {
                System.out.println("captal letter found ::: "+ascii);
            }
        }
    }
    

提交回复
热议问题