Char array not creating String Object

Hi,

I am getting a char[] after executing a DB Stored Proc from Sybase DB . But the value returned is Cha [] instead of String. I understand that string and char[] are same . but that is not the case . When I try to display the string in JTextarea it does not honor the \n . Slso the spilt method of String too does not work.

Can some one help me to convert this char[] to pure String object when I can apply all the String methods like spilt() , index of etc

Regards

Java Knight

[512 byte] By [Java_Knight_123a] at [2007-11-27 10:45:13]
# 1

String has constructors that use a char array.

ChuckBinga at 2007-7-28 20:11:43 > top of Java-index,Core,Core APIs...
# 2

> I understand that string and char[] are same

No

> but that is not the case

Yes

ejpa at 2007-7-28 20:11:43 > top of Java-index,Core,Core APIs...
# 3

> I understand that string and char[] are same .

You are confusing Java with C.

In C, a string (note the lower case) is a char[] with '\0' as last element.

In Java, a String is an object that can however be constructed from a char[].

HTH

java_knighta at 2007-7-28 20:11:43 > top of Java-index,Core,Core APIs...