Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started