<pre name= "code" class= "Java" >import java.util.ArrayList;
Import java.util.List;
Import Java.util.Scanner; public class Find_az {static int a=0;
Defining static variables is convenient for counting public static void main (string[] args) {System.out.println ("Please enter the content and end with ends");
@SuppressWarnings ("resource") Scanner sc=new Scanner (system.in);
String str= "";
List<string>str_list=new arraylist<string> ()//Store data while (!str.equals ("End")) {str=sc.nextline ();
Str_list.add (str);
//Multiline input end System.out.println ("Please enter the character you want to find A-Z");
System.out.println ("");
@SuppressWarnings ("resource") Scanner scc=new Scanner (system.in);
String X=scc.next ();
Char X1=x.charat (0); Converts a string type to a char type to facilitate the subsequent conversion of each string into an array a matching embarrassment would only be this stupid method for (int i=0;i< (Str_list.size ()-1); i++)//length minus one or you'll lose the end.
Enter out {char[] S=str_list.get (i) ToCharArray ();
for (int i1 = 0;i1<s.length;i1++)//{if (s[i1]==x1) a++ that is used to accumulate the number character;
} System.out.println (a); }
}/* Comment
list< type > Only item string that can store the specified type
is string ...
String[] is an array, fixed-length, immutable
list<string> is generic, not fixed-length, variable
Not very good to achieve and a little bit of a bug shame
* *