Tuesday, December 23, 2014

Java boolean and byte and char



Java boolean

public class JavaBooleanExample
{
public static void main(String[] args)
{
 boolean = ;
boolean b1 = true;
boolean b2 = false;
boolean b3 = (10 > 2)? true:false;             
System.out.println("Value of boolean variable b1 is :" + b1);
System.out.println("Value of boolean variable b2 is :" + b2);
System.out.println("Value of boolean variable b3 is :" + b3);            
  }
}

Java byte

public class JavaByteExample
public static void main(String[] args)
{
 byte = ;
 byte b1 = 100;
 byte b2 = 20;
System.out.println("Value of byte variable b1 is :" + b1);
System.out.println("Value of byte variable b1 is :" + b2);
 }
}

Java char

public class JavaCharExample
{
public static void main(String[] args)
{
char = ;
char ch1 = 'a';
char ch2 = 65;
System.out.println("Value of char variable ch1 is :" + ch1);   
System.out.println("Value of char variable ch2 is :" + ch2);             
   }
}

No comments:

Post a Comment