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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.