Can we extend the String class?

Answer Posted / maurya

We can`t extends String class because java make it final
and thats why we say String in java are immutable.
final..
class--->can not inharitted.
method-->can not overridden
variable->its valu can not change after once initialized.

Is This Answer Correct ?    16 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does java not allow multiple public classes in a java file ?

3421


What is constructor chaining and how is it achieved in java?

559


How to sort array of 0 and 1 in java?

532


What does this () mean in java?

530


Can I learn java in 3 months?

526






What is the this keyword?

541


How do you use compareto?

540


What is a pattern what is an anti pattern?

496


Can there be an abstract method without an abstract class?

523


Explain the features of java?

575


You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain

516


How many ways can we create singleton class?

488


What is a jit compiler?

623


What is a generic data type?

558


What are annotations in java?

610