Answer to Question #201958 in Java | JSP | JSF for Karon Aldrich

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.

1
Expert's answer
2021-06-05T02:11:08-0400

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS