CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS J2EE JAVA DETAILS
Question :
String class can be extendable? and why?
Category Java Interview Questions
Rating (5.0) By 1 users
Added on 5/20/2008
Views 1280
Rate it!
Answers:



No.String class cannot be extened as it is final class.



 Posted by: Aruna    

Contact Aruna  Contact Aruna

String class is a final. Hence it can not be extended.



 Posted by: Nishant Patil    

Contact Nishant Patil  Contact Nishant Patil

String classes are once of the core classes provided by java library and probably is one of the most frequently used class as well. It is marked Final and CANNOT be extended.
Classes are marked final in order to retain their behavior.

For Strings,It is because in case if someone extends the String class and overrides the methods, the behavior will become sad. You don't want you String class to behave abnormally,thats why it is marked final.



 Posted by: Sushant Kunal    

Contact Sushant Kunal  Contact Sushant Kunal


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is the difference between attribute and parameter ?
View Answer
What is the difference between length and length() ?
View Answer
What is the difference between concat and append?
View Answer
What is the difference between Java and J2EE? Is J2EE advanced version of Java?
View Answer
How do u create objects at runtime?
View Answer
What is a string Handling? How to use it? what is difference b/w Event handling?
View Answer
What is multi threading ?
View Answer
What are the main differences between
jdk1.4 n jdk1.5?
View Answer
Given A = 1, B = 2, C = 3, D = 4 ?? Z = 26, write a java standalone
program to encode the word ?TELEPHONE? into numbers.
View Answer
Write a java standalone program / method to take out all the special
characters in the string provided below.
//ASCII a ? z (97 ? 122)
String sSENTENCE = ?This!is^a$t*e)s|t?;
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL Java Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/15171/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.75