Concepts: What is a method signature? Why Java can be compiled once and run on d
ID: 3569615 • Letter: C
Question
Concepts:
What is a method signature?
Why Java can be compiled once and run on different platforms?
What is API, where to find it?
What is a formal parameter?
What is software bug and what is debugging?
What is an actual parameter?
How to call a method in another class? (Use the full name:
ClassName.methodName(argument_list))
What is the meaning of pass-by-value?
What are overloaded methods?
What is a local variable?
What are the benefits of using methods?
What is a package?
What are the benefits of using packages?
What is stepwise refinement?
What is a constructor?
What is the main difference between invoking a static method and invoking a non-static
method?
What is the difference between variables of primitive data types and reference variables
of arrays or objects?
What are the difference between constructors and methods?
Explanation / Answer
1.
A method signature is part of the method declaration. It is the combination of the method name and theparameter list.
The reason for the emphasis on just the method name and parameter list is because of overloading. It's the ability to write methods that have the same name but accept different parameters. The Java compiler is able to discern the difference between the methods through their method signatures.
Examples:
public void setMapReference(int xCoordinate, int yCoordinate)
{
//method code
}
The method signature is setMapReference(int, int)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.