Question: Write a static method called getCounts that takes a string as a parameter. The string will only contain alphabetic letters (i.e. a to z both

Write a static method called getCounts that takes a string as a parameter. The string will only contain alphabetic letters (i.e. a to z both upper and lower case) and digits (0 - 9). Return an integer array of length 3 that has a count of the digits in the string at index 0; the count of the upper-case letters at index 1, and the count of the lower-case letters at index 2.

For example, if "Cat123" is passed as an argument, an array is returned by the method that would be equivalent to int[]{3, 1, 2).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!