+ 16
Might some correction is possible in a java quiz
👉what is valid about static method ? answer ::: u can use it by calling its class i think it must be ::: u can call it by using the class name where its definition is given //every1 makes it correct bcz just after seeing static ... they search for class somewhere & that will be the only answer //what U think ???
4 Antworten
+ 14
statics methods also gets inherited ... so when we call method from subclass that is present in super class ... we call it by <name of superclass>. method ()
+ 1
"using the class name where its definition is given" is more restrictive, wouldn't that mean that you couldn't call a static method of a superclass from a subclass?
+ 1
what I'm saying is that you can call <name of subclass>.method() which doesn't quite align with the proposed amendment, so more careful wording is needed
0
2nd one