Solved

A Programmer Tries to Create a Subclass of String Called

Question 36

Short Answer

A programmer tries to create a subclass of String called MyString. When the programmer compiles her new class, the compiler produces the following message:

MyString.java:1: cannot inherit from final java.lang.String
public class MyString extends String {
^
1 error

Explain the cause of this error.

Correct Answer:

verifed

Verified

The String class has been decl...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents