Question #201958

 Explain your own example of how you can use Java Math and String capabilities to find out something about a textual String object.

Expert's answer

You can use Math.max () and String.charAt () to find out the maximum ASCII value in a string. Sample code:


String example = "That's an example!";
int max = example.charAt(0);
for (int i = 0; i < example.length(); i++) {
    max = Math.max(example.charAt(i), max);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS