/*******************************************************************
** This Java program is to illustrate the Primitive data type.
** It declares all the primitive data type as well as initializes them.
** To read these data type from the keyboard, we have to use
** The Console class in corejava library.  The Console class does not
** support all the methods to read each data type, so we used the
** available ones (readInt, readString and readDouble).
** It shows how to format some the numbers using corejava and text
** packages.
********************************************************************/
public class PrimitiveDataType_1
{
  boolean      TrueOrFalse    = false;
  char         CharHas16Bits  = 'A';
  byte         ByteHas8Bits   = 12;
  short        ShortHas16Bits = 155;
  int          IntHas32Bits   = 10;
  long         LongHas64Bits  = 1234;
  float        Float_1        = (float)3.1; // must be casted
  double       DoublePrecision = 19.9;
  String       Title = "Primitive Data Type";



  public PrimitiveDataType_1()   // constructor
  {
    System.out.println("\t\t" + Title);
    System.out.println("\n******************************************\n");
    System.out.println("Char16Bits      = " + CharHas16Bits);
    System.out.println("ByteHas8Bits    = " + ByteHas8Bits);
    System.out.println("ShortHas16Bits  = " + ShortHas16Bits);
    System.out.println("IntHas32Bits    = " + IntHas32Bits);
    System.out.println("LongHas64Bits   = " + LongHas64Bits);
    System.out.println("Float_1         = " + Float_1);
    System.out.println("DoublePrecision = " + DoublePrecision);
    if(TrueOrFalse)
      System.out.println("SetToTrue     = TRUE");
    else
      System.out.println("SetToTrue     = FALSE");
    System.out.println("\n******************************************");
  }
  /****************************************************/
  public static void main(String [] args)
  {
    PrimitiveDataType_1    MyPrimitiveDataType
                           = new PrimitiveDataType_1();
	 try
	 {
		 System.in.read();
	 }
	 catch(Exception MyException)
	 {
		 //do nothing
	 }

  }

}
