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
πŸ’¬ Discuss
βœ… Correct Answer: (A) true
Explanation: Output will be True. Since when s1.charAt(0) ascii value is greater then s2.charAt(0). So it will return True.
Explanation by: Vinay
Output will be True. Since when s1.charAt(0) ascii value is greater then s2.charAt(0). So it will return True.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
204
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
82%
Success Rate