Java Blog

 
 
 
 public class JAVA_018
 {

    public static void main(String[] args)
    {
       char Symbol=\'\\0\';

       Symbol=(char)(Math.random( )*128);

       if(Symbol>=\'A\' && Symbol<=\'Z\')
          System.out.println(\"The Random Character Generated is a Capital Letter : \" + Symbol);

       else if(Symbol>=\'a\' && Symbol<=\'z\')
          System.out.println(\"The Random Character Generated is a Small Letter : \" + Symbol);

       else
          System.out.println(\"The Random Character Generated is not a letter\");
    }
 }

 
 
Didn't find what you were looking for? Find more on Program to show the use of Conditional AND Operator (&&) in If Statements