Manipulating Character in JAVA.(UpperCase | isLowercase | toUppercase | toLowerCase | isLetterOrDigit | isWhitespace in JAVA)
CODING:
class Manipulating Character
{
public static void main(String[] args)
{
char c='K';
System.out.println("Char C=" + c);
if(Character.isUpperCase(c)){
System.out.println(c + " is UpperCase");
}
else{
System.out.println(c + " is Not UpperCase");
}
if(Character.isLowerCase(c)){
System.out.println(c + " is UpperCase");
}
else{
System.out.println(c + " is Not UpperCase");
}
c=Character.toLowerCase(c);
System.out.println("After to LowerCase:"+ c );
c=Character.toUpperCase(c);
System.out.println("After to UpperCase:"+ c );
if(Character.isLetterOrDigit(c)){
System.out.println(c + " is Letter Or Digit.");
}
else{
System.out.println(c + " is Not Letter Or Digit.");
}
if(Character.isWhitespace(c)){
System.out.println(c + " is Whitespace");
}
else{
System.out.println(c + " is Not Whitespace");
}
}
}
class Manipulating Character
{
public static void main(String[] args)
{
char c='K';
System.out.println("Char C=" + c);
if(Character.isUpperCase(c)){
System.out.println(c + " is UpperCase");
}
else{
System.out.println(c + " is Not UpperCase");
}
if(Character.isLowerCase(c)){
System.out.println(c + " is UpperCase");
}
else{
System.out.println(c + " is Not UpperCase");
}
c=Character.toLowerCase(c);
System.out.println("After to LowerCase:"+ c );
c=Character.toUpperCase(c);
System.out.println("After to UpperCase:"+ c );
if(Character.isLetterOrDigit(c)){
System.out.println(c + " is Letter Or Digit.");
}
else{
System.out.println(c + " is Not Letter Or Digit.");
}
if(Character.isWhitespace(c)){
System.out.println(c + " is Whitespace");
}
else{
System.out.println(c + " is Not Whitespace");
}
}
}
Comments
Post a Comment