Ashik Uzzaman
Engineering Manager, Marqeta, Oakland, CA, USA
Darryl Failla
Sun Certified Java 2 Programmer
----SCJP Java 2----
Originally posted by Alan Mar:
I didn't get a chance to run the code in Q2. But I remembered
that static methods don't participate in overriding at all. So is it legal to have the same method signature in the sub class?
I prefer A choice in Q2. Please correct me if I'm wrong.
Originally posted by darryl failla:
This suggests that there is no TRUE overriding of static methods between classes and subclasses. Is this true?
Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Originally posted by FEI NG:
Q1) A.Compilation Error
if you have a public static main(String arg[]) in class A
u probably want to name this file A.java right? So
it will run the main method right?
but your also have a public class B in the file.
You can't do that.
if you have B.java as your file name.
There is no output. Cuz there is no main method to be run.
Muhammad Farooq<br />Sun Certified Programmer for Java 2 Platform<br />Oracle8i Certified Professional Database Administrator
Jane Griscti
SCJP, Co-author Mike Meyers' Java 2 Certification Passport
Muhammad Farooq<br />Sun Certified Programmer for Java 2 Platform<br />Oracle8i Certified Professional Database Administrator
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Originally posted by ravish kumar:
confusion....
if static methods are not inherited then how come they can be accessed without using class name ???
Originally posted by Muhammad Farooq:
Thanks Jane, I understand now that the static members are not inherited but are still accessible.
--Farooq
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh