Question: Which statement about the method in the Java programming language is true? a.If we want to call a public method of Class A from Class
Which statement about the method in the Java programming language is true?
a.If we want to call a public method of Class A from Class B, we only can call the method via the object of Class A.
b.A non-static public method can be called by the object of the class at anywhere, but the non-static private method can only be called inside the same class.
c.The formal arguments and the actual arguments of a method can have different data types.
d.If a method does not return any value, we don't need to specify anything in the return type of its definition.
e.Assuming a method contains a local variable with the same name as a global variable, by default, using the variable inside the method will refer to the global value because the global variable has a higher priority than the local variable.
Step by Step Solution
There are 3 Steps involved in it
b A nonstatic public method can be called by the object of the class at anywhere but the nonstatic p... View full answer
Get step-by-step solutions from verified subject matter experts
