Mar 19, 2010

JAVA Program to Print he Default Values

class Defaultvalues
{
static int a;
static byte b;
static char c;
static short s;
static long l;
static float f;
static double d;
static boolean bl;
public static void main(String[] args)
{
 System.out.println("Default values of various data types");
  System.out.println("int: "+a);
System.out.println("byte: "+b);
System.out.println("char: "+c);
System.out.println("short: "+s);
System.out.println("long: "+l);
System.out.println("float: "+f);
System.out.println("double: "+d);
System.out.println("boolean: "+bl);
}
}
Download this program Here

1 comment:

  1. Output:
    Default values of various data types:
    int: 0
    byte: 0
    char:
    short: 0
    long: 0
    float: 0.0
    double: 0.0
    boolean: false

    ReplyDelete