String[] temp=null;
String st3=new String(temp);
I am using this code.. but error message is coming.
Give solution to recover this error.
Printable View
String[] temp=null;
String st3=new String(temp);
I am using this code.. but error message is coming.
Give solution to recover this error.
Also posted here.
A string array instance is an object. So you would convert it by doing nothing.
The code you posted shows you attempting to create a string from an array of strings. What exactly are you trying to do? Concatenate the string elements? Create a "toString()" form for the array? Something else?
String arr[]={"s","y"};
// converting array of string into str object....
String str=new String(arr.toString());
I think u are having character array ..not string I think....
Is this you want.
class Test
{
public static void main(String args[])
{
char c [] ={'r','a','m'};
System.out.println(new String(c));
}//main
}//class
Hi thank you for your reply....
I got output for this one.