Types_Code_ Assignment: Java I         P.Komisar


// An instructor with a fading memory prepared the code for this class. He has left it to you to fill
// in the blanks to make it work. Fill in the blanks, compile, run and answer the question below.
 

public _____ Types{
static   ____ b;
static   _____ s;
static   ____i;
static   ____ l;
static   _____ f;
static   ______ d;
static   ____ c;
static   ______ boo;

public ______ void main(String[] argv){ // Here's main
   Types t=___ Types();                 // The class instantiated by the default constructor
   t.show(b);
   t.show(s);
   t.show(i);
   t.show(l);
   t.show(f);
   t.show(d);
   t.show(c);
   t.show(boo);
   }
 

void show(byte z){System.out.println(z);}     // Here's an overloaded method show()
void show(short z){System.out.println(z);}
void show(int z){System.out.println(z);}
void show(long z){System.out.println(z);}
void show(float z){System.out.println(z);}
void show(double z){System.out.println(z);}
void show(char z){System.out.println(z);}
void show(boolean z){System.out.println(z);}
}



Questions

Q1 What is this class printing the default values for?
Q2 In a table associate the each primitive types with the default values the compiler assigns.