COP3252 Chapter 6 Flashcards
A well-designed method
performs a single, well defined task
To declare a method as static, place the keyword static before ________ in the method’s declaration
The return type
Declaring main as ________ allows the JVM to invoke main without creating an instance of the class
static
In the statement result = calculateValue(x,y);
what are x and y called?
arguments
Stacks are which type of data structure
LILO
FILO
FIFO
LIFO
LIFO
What is an overloaded method?
has the same name as another method, but different parameters (by number, types or order of the types)
Method 1
void getSum( int a, int b)
Method 2
void getSum( double a, double b)
Does method 2 properly overload method B?
Yes
How are two methods of the same name distinguished?
Both number and types of arguments