strings in java are objects.why?

Answer Posted / modi

In Java strings are objects designed to represent a sequence
of characters. Because character strings are commonly used
in programs, Java supports the ability to declare String
constants and perform concatenation of Strings directly
without requiring access to methods of the String class.
This additional support provided for Java Strings allows
programmers to use Strings in a similar manner as other
common programming languages.
A Java String is read-only and once created
the contents cannot be modified.

Is This Answer Correct ?    14 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is number data type?

534


What is a package in java? List down various advantages of packages.

762


Is java free for commercial?

493


How are variables stored in memory?

585


Write a java program to print fibonacci series?

543






Describe what happens when an object is created in java ?

555


What is meant by memory leak?

544


Explain the difference between transient and volatile in java?

580


what are Hostile Applets?

1610


How can you handle java exceptions?

531


Why chararray() is preferred over string to store the password?

532


java program with complete 4 oops concepts implemented example

2732


What are the various access specifiers in java?

571


Is there any limitation of using inheritance?

573


Can we convert integer to string in java?

600