Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions