Examveda

The String method compareTo() returns

A. true

B. false

C. an int value

D. 1

E. -1

Answer: Option C


This Question Belongs to Java Program >> Strings

Join The Discussion

Comments (1)

  1. Mounika Gutha
    Mounika Gutha:
    7 years ago

    compareTo() method compares first argument with second argument and returns positive number , if first argument is bigger than the second number .
    returns negitive number if first argument is less than second argument and zero if both are equal

Related Questions on Strings