public class A{
public static void main(String[]args){
try{
Scanner sc=new Scanner(System.in);
/* System.in means input of the system which is
* keyboard, where as System.out means output of
* the System which is monitor (console)
*/
String s;
s=sc.next(); // reads a word stopping at first space after
the word
System.out.println("you gave="+s);
char firstCharacter;
firstCharacter = s.charAt(0);
System.out.println("your first char was="+firstCharacter);
if (firstCharacter == 'R'){
System.out.println("your first char was an upper case
r");
}else if (firstCharacter == 'r'){
System.out.println("your first char was a lower case
r");
}
int i;
i=0;
while(i
"+s.charAt(i));
++i;
}
} catch (Exception e){
System.out.println("oops, something went wrong.");
No comments:
Post a Comment