java program to change the case just opposite

import java.io.*;
import java.util.*;
public class upsidedowncase
{
public static void main(String args[])
{
Scanner s=new Scanner(System.in);
String sourse,temp,c,destination;
System.out.println("Enter the String with mixed case:");
sourse=s.nextLine();
temp=sourse.toUpperCase();
for(int i=0;i<sourse.length();i++)
{
c=String.valueOf(sourse.charAt(i));
if(sourse.charAt(i)==temp.charAt(i))
{
System.out.print(c.toLowerCase());
}
else
{
System.out.print(c.toUpperCase());
}
}
}
}
OUTPUT:

simple java code,case change,string program,conversion of case,java sample code


post your comments here.....
Share on Google Plus
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment