30.3k views
5 votes
You can tell that the equals() method takes a ____ argument because parentheses are used in the method call.

a.
Boolean

b.
Double

c.
String

d.
Null

User Kakush
by
4.8k points

1 Answer

5 votes

Answer:

c. String

Step-by-step explanation:

The equals method in java String class takes an object reference as a parameter. We can compare two Strings with the help of equals method of the String class. The equals() method of the java String class compares the given strings based on the content of the string.

Use of the String equals method:-

if (stringOne> stringTwo) it will return a positive value.

if both of the strings are equal lexicographically means

(stringOne == stringTwo) it will return 0.

if (stringOne < stringTwo) it will return a negative value.

User Ryan Buening
by
5.2k points