Check the true statement(s) (there is at least one correct choice, p
1. Check the true statement(s) (There is at least one
correct choice, possibly more.) An instance method can
access a static member (of the same class) inside its
definition using only the member name, no object or class
name prepended (i.e., without ClassName. or someObj. in
front). A static method can access an instance member
(of the same class) inside its definition using only the
member name, no object or class name prepended (i.e.,
without someObj. in front). An instance method can
access an instance member (of the same class) inside its
definition using only the member name, no object or class
name prepended (i.e., without ClassName. or someObj. in
front). A static method can access a static member (of the
same class) inside its definition using only the member
name, no object or class name prepended (i.e., without
ClassName. or someObj. in front).
Solution
Option 1, 3 and 4 are correct.
Static method is the technique which is proclaimed with
static keyword.Instance method is the method which is not
with static keyword.Static method implies which will exist
as a solitary duplicate for a class.But occurrence
techniques exist as various duplicates relying upon the
quantity of occasions made for that class.We will get each
2. different duplicate of example technique in each protest
that we have made for that class.
Since static technique is the single duplicate per class that
is considered as individuals particular to class.So,static
strategies can be called or summoned by utilizing class
reference. Occasion or non static techniques are
summoned on the occurrence made means by utilizing
object reference.They are considered as case
members.Static strategies are not included in legacy where
as case techniques are included in inheritance.That implies
when we make a case of kid class, just example techniques
will spill out of parent class to tyke class.