write a method called luckyAs that takes any array of string
Solution
// LuckyCharacter.java
 // counts frequency of capital A in string Array
import java.util.Scanner;
public class LuckyCharacter
 {
     public static int LuckyAs(String[] str)
     {
         char ch;
         char c =\'A\';
         int count=0;
        for(int i=0; i<str.length; i++)
         {
             for (int j = 0;j < str[i].length();j++ )
             {
                 ch = str[i].charAt(j);
                 if(ch == c)
                 {
                     count++;
                 }
             }
           
         }
         return count;
     }
    public static void main(String args[])
    {
         Scanner scan = new Scanner(System.in);
         int totalString = 3;
       
         String[] str = new String[totalString];
         str[0] = \"Aloo\";
         str[1] = \"BArAk\";
         str[2] = \"BlAck Olives\";
        System.out.println(\"The character A has occurred for \" + LuckyAs(str) + \" times\");
       
    }
 }
/*
 output:
The character A has occurred for 4 times
*/


