source code Character
package wclasses;
public class SampleCharacter {
public static void main(String att[])
{
// constructors
Character c1= new Character('j');
// wrapper to primitive
char pc1=c1.charValue();
System.out.println(pc1);
//primitive to string
String s1=c1.toString();
String s2=Character.toString('a');
System.out.println(s1);
System.out.println(s2);
//String to wrapper object
Character c2= new Character('a');
System.out.println(c2);
//wrapper to string
String s3=c2.toString();
}
}
output:
j
j
a
a
0 comments:
Post a Comment