✏️ Explanatory Question

Write a statement each to perform the following tasks on a string:

👁 89 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

(i) Extract the second last character of a word stored in the variable wd.


char secondLastChar = wd.charAt(wd.length() - 2);

(ii) Check if the second character of a string str is in uppercase.


boolean isUpperCase = Character.isUpperCase(str.charAt(1));