Orphaned default - problem
807588Jan 26 2009 — edited Jan 26 2009I am a studying SCJP and am a newbie. My tutor wanted me to write a simple program to display the default values of data types. I tried it in the following ways, but there is an error - orphaned default. How do I fix this??
-----------------------------------------------------------------------
class H{
public static void main(String[] args)
{ boolean x; {if (x==x)
{
}
default:}
}
}
--------------------------------------------------------------------------
class W{
public static void main(boolean x, boolean y)
{ if (x==y)
{
}
default:
}
}
Please help