Getting sightly confused...I read that static method does not override but in the below program its not following that rule...Can anyone please explain it in detail.Here is the program
The Output of program is class A method output.
public class JavaApplication6 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
A a=new B();
a.r();
}
}
class B extends A{
static int d=200;
static void r(){
System.out.println("hiiiiiiiiiiiiiiiii r"+d);
}
}
class A {
static int a=10,c=20;
static void r(){
System.out.println("hiiii ar"+a);
}
}