Which of the follwing is true about static modifier.
A.static can be applied to : instance variables, methods,
code Segments and classes.
B.a static method cannot be overridden.
C.inner classes can be both static & private.
D.a static reference cannot be made through non static
method or code block.
E.abstract & static both can be applied together to a
method.
One of the answer is B.
How is it ? Check this program�����..No error nothing�Compiles and run..
class A
{
static void m()
{
System.out.println("In super class");
}
}
public class StaticOverride extends A
{
static void m()
{
System.out.println(" In Subclass");
}
public static void main(
String args[])
{
StaticOverride ob = new StaticOverride();
m();
}
}