// Program
public
class StringExample
{
public static void main(String args[])
{
String s1="Sukhvir";//String
Literal
char
ch[]={'G','U','L','Z','A','R'};//Declaration of Character Array
String s2=new String(ch);//Conversion
of Character Array to String
String s3=new
String("Khanna");//Creation of Java String using new
//Printing of All the above strings
System.out.println(s1);
System.out.println(s2);
System.out.println(s3);
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.