Using Boolean Zen, write an improved version of the following method, which returns whether the given String

Question:

Using “Boolean Zen,” write an improved version of the following method, which returns whether the given String starts and ends with the same character:

public static boolean startEndSame (String str) { if (str.charAt (0) str.charAt (str.length () - 1)) { return true; } else { return false; {

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question
Question Posted: