1.

Write a statement each to perform the following task on a string : (i) Extract the second last character of a word stored in the variable wd. (ii) Check if the second character of a string str is in uppercase.

Answer»

(i) char ch=wd.charAt(wd.length()-2); 

(ii) if(Character.isUpperCase(str.charAt( 1))) 

{

 //statement; 

}



Discussion

No Comment Found

Related InterviewSolutions