English

Write the output of the following String methods: String x="Galaxy",y="Games"; (a) System.out.println(x.charAt(0)==y.charAt(0)); (b) System.out.println(x.compareTo(y)); - Computer Applications

Advertisements
Advertisements

Question

Write the output of the following String methods:

String x="Galaxy",y="Games";
(a)  System.out.println(x.charAt(0)==y.charAt(0));
(b)  System.out.println(x.compareTo(y));
One Line Answer
Advertisements

Solution

  1. true
  2. -1
shaalaa.com
  Is there an error in this question or solution?
2024-2025 (March) Specimen Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×