About Question com.enthuware.ets.scjp.v6.2.42 :
Posted: Wed Nov 16, 2011 12:12 pm
class Assertion
{
public void assert(int k)
{
System.out.println("k is "+k);
}
public static void main(String[] args)
{
A a = new A();
a.assert(Integer.parseInt(args[0]); //4
}
}
That class will not compile, because class A is not known. Probably in main ther should be "Assertion a = new Assertion();"
{
public void assert(int k)
{
System.out.println("k is "+k);
}
public static void main(String[] args)
{
A a = new A();
a.assert(Integer.parseInt(args[0]); //4
}
}
That class will not compile, because class A is not known. Probably in main ther should be "Assertion a = new Assertion();"