public class CharAtDemo{
public static void main(String[]args)
{
String s1="shashikant";
char c=s1.charAt(4);
System.out.println(c);
}
}
char to String convertion
public class StringEx
{
public static void main(String[]args)
{
char ch[]={'s','h','a','s','h','i'};
String s1=new String(ch);
System.out.println(s1);
}
}
public static void main(String[]args)
{
String s1="shashikant";
char c=s1.charAt(4);
System.out.println(c);
}
}
char to String convertion
public class StringEx
{
public static void main(String[]args)
{
char ch[]={'s','h','a','s','h','i'};
String s1=new String(ch);
System.out.println(s1);
}
}
0 comments:
Post a Comment