Vidyalelo
Java Programming · Q34

Strings

Programming · Java Programming · question 34

Q34

Determine output: public class Test public static void main(String args[]) String s1 = "SITHA"; String s2 = "RAMA"; System.out.println(s1.charAt(0) > s2.charAt(0));

A.
true
Answer
B.
false
C.
0
D.
Compilation error
E.
Throws Exception

Answer: Option A

Solution

Answer: Option A
Solution:
Output will be True. Since when s1.charAt(0) ascii value is greater then s2.charAt(0). So it will return True.