Can we extend the String class?

Answers were Sorted based on User's Feedback



Can we extend the String class?..

Answer / om

No, we can not extend the String class b'coz it's a final
class...
if a class is final, it's not possible to perform
inheritance operation on that class

Is This Answer Correct ?    50 Yes 4 No

Can we extend the String class?..

Answer / 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

Can we extend the String class?..

Answer / shashi shaw

no we cant.becoz string ia a immutable class.

Is This Answer Correct ?    6 Yes 16 No

Post New Answer

More Core Java Interview Questions

What is the preferred size of a component in java programming?

0 Answers  


Can I learn java in 3 months?

0 Answers  


Difference between association, composition and aggregation?

0 Answers  


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

0 Answers   Amazon,


What is thread count in java?

0 Answers  






Is java good for beginners?

0 Answers  


When you declare a method as abstract method ?

2 Answers   HP,


Name the method of a Container that can be used to cause a container to be laid out and redisplayed?

1 Answers  


what is a package?

11 Answers  


Can we extend private class in java?

0 Answers  


What is Java Reflection API? Why it’s so important to have?

0 Answers  


Write code to implement bubble sort in java?

0 Answers  


Categories