By arunraj
What is the output of the following program?
public class TestSample {
public static void testMethod()
{
System.out.println("static testMethod");
}
public static void main(String[] args)
{
TestSample ts = null;
ts.testMethod();
}
}
Output:
static testMethod
-- A static method can be called from an object reference even if it points to a null value.
-- A static method can be called from an object reference even if it points to a null value.
Interview Questions: