0
import java.util.Scanner;
class example{
  public static void main(String args[]){
 Scanner in = in.next(.charAt(0));
    char ch='';
    
   if(ch>='A'&& ch<='Z')
   {
     System.out.println("the character is uppercase");
     
   }
  else if(ch>='a' && ch<='z')
   {
     System.out.println("the character is lowercase");
   }
   
     else
     {
       System.out.println("some special character");
     }
  }
}

plz tell me the way to accept a character in the java coding as m confused with this silly program

how to use these commands and wat are there packages ....m not gettin the package for Math class also plz help me with this stuff ..\

char tmp = (char) System.in.read();
char tmp = (char) new InputStreamReader(System.in).read ();
char tmp = (char) System.console().reader().read();

Edited by peter_budo: n/a

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by mitchiexlolz
0

Use a buffered reader. then get the value as string.

InputStreamReader reader = new InputStreamReader (System.in);
        BufferedReader input = new BufferedReader (reader);
        String text;
        char character;
       text = input.readLine();
       character = text.charAt(0);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.