Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If c is a char, and s is a String, which of the following expressions will resul

ID: 3677007 • Letter: I

Question

If c is a char, and s is a String, which of the following expressions will result in a compile error? (Select all that apply.)

1. c == 'A'

2. c.toUpperCase()

3. s.toUpperCase()

4. String.toUpperCase(s)

5. c.equals('A')

6. s == "ABC"

7. s.equals("ABC")

8. Character.toUpperCase(c)

If c is a char, and s is a String, which of the following expressions will result in a compile error? (Select all that apply.)

1. c == 'A'

2. c.toUpperCase()

3. s.toUpperCase()

4. String.toUpperCase(s)

5. c.equals('A')

6. s == "ABC"

7. s.equals("ABC")

8. Character.toUpperCase(c)

Explanation / Answer

If c is a char, and s is a String, which of the following expressions will result in a compile error? (Select all that apply.)


1. c.equals('A')   - wrong

2. s == "ABC" -- wrong

3. Character.toUpperCase(c) -OK

4. String.toUpperCase(s) -Wrong

5. s.toUpperCase( )- Wrong

6. s.equals("ABC")- OK

7. c == 'A'- wrong

8. c.toUpperCase( ) -OK

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote