-4

Is this method type hiding? How static method gets area in memory?

public class Demo {
            public static final void main(String args[]) {
                try{
                    A a = new B();
                    a.display();
                }catch(Exception e){
                    e.printStackTrace();
                }
            }

        }

        class A{
            static void display(){
                System.out.println("A");
            }
        }
        class B extends A{
            static void display(){
                System.out.println("B");
            }
        }
Reporter
  • 3,897
  • 5
  • 33
  • 47
  • [Some similar questions](https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=site:stackoverflow.com+java+static+method+overload+override) – Hovercraft Full Of Eels Jan 30 '17 at 12:48

1 Answers1

0

Static methods dont belong to a instance but to a class, overriding some static method makes no sense and java will not let you to do that

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97