A

Admin • 828.03K Points
Coach

Q. 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
  • (B) false
  • (C) 0
  • (D) 0 D. Compilation error
  • Correct Answer - Option(A)
  • Views: 17
  • Filed under category Java
  • Hashtags:

Explanation by: Admin
Output will be True. Since when s1.charAt(0) ascii value is greater then s2.charAt(0). So it will return True.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.