Answer Posted / nikhil agrawal
Main method is static and static method is not override.
For example:- if i have Class A having main method and Class B extends Class A and also having the main method. in that case Class B hide the main method of A not override.
overriding process occur on run time and but static method load on compile time. that's its the reason we can not override main method but we can hide it.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the difference between compiler and jvm?
What are the application of stack?
What are exceptions
What exactly is a .class file?
What is a flag and how does it work?
What is a locale?
What is thread count in java?
What is java volatile?
Can a constructor be private and how are this() and super() method used with constructor?
What is an anonymous class in java?
What are data types in oop?
What is an immutable class?
Can we instantiate interface in java?
What is the purpose of main function in java?
What is :: operator in java 8?