Originally posted by Jane Griscti:
Amit,
Can you post a copy of the code?
Here is the code which prints nothing (blank) for the default value of the char
class Xyz
{
private int x;
public void getX()
{
x = 10;
System.out.println(x);
}
}
public class Separation extends Xyz
{
/*private static int i;
private static short sh;
private static long l;
private static byte b;
private static boolean bl;
private static double d;
private static float f;
private static Separation s1;
*/
private char c;
private int i;
private short sh;
private long l;
private byte b;
private boolean bl;
private double d;
private float f;
private Separation s1;
public static void main (
String [] args )
{
Separation s = new Separation();
/*System.out.println ("Hello World");
System.out.println ("int i = "+i);
System.out.println ("short sh = "+sh);
System.out.println ("long l = "+l);
System.out.println ("byte b = "+b);
System.out.println ("boolean bl = "+bl);
System.out.println ("float f = "+f);
System.out.println ("double d = "+d);
ystem.out.println ("Object s = "+s1);
*/
int z=0;
System.out.println ("Object z = "+z);
s.getX();
s.abc();
s.getDefault();
}
public void getDefault()
{
System.out.println ("Hello World");
System.out.println ("int i = "+i);
System.out.println ("short sh = "+sh);
System.out.println ("long l = "+l);
System.out.println ("byte b = "+b);
System.out.println ("boolean bl = "+bl);
System.out.println ("float f = "+f);
System.out.println ("double d = "+d);
System.out.println ("Object s = "+s1);
System.out.println ("Char = "+c);
}
public void abc()
{
getX();
}
}