strings in java are objects.why?

Answers were Sorted based on User's Feedback



strings in java are objects.why?..

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

strings in java are objects.why?..

Answer / shankar

Strings in java are immutable i.e, not changable.It is
constant.
By,
Shanku

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More Core Java Interview Questions

When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?

0 Answers  


Can a constructor call another constructor?

0 Answers  


How to make a method thread safe without using synchronized keyword?

8 Answers   Persistent, Societe Generale,


What is meant by oops concept in java?

0 Answers  


Where can I find jdk in my computer?

0 Answers  






Can you instantiate the math class?

0 Answers  


Can classes declared using the abstract keyword cab be instantiated?

0 Answers   MCN Solutions,


What is variable declaration and definition?

0 Answers  


What is the private method modifier?

0 Answers  


suppose in a class there is a code like this: { Set hs=new Hashset(); hs.add(new Emp("kathy",1000)); hs.add(new Emp("kathy",2000)); } how can u avoid the above code in your class as set won't allow duplicate objects?

3 Answers  


wHAT IS DEFAULT SPECIFIER IN JAVA wHAT IS DEFAULT CONSTRUCTOR IN JAVA wHAT IS DEFAULT METHOD IN JAVA

12 Answers   IBM,


What is the generic class?

0 Answers  


Categories