Question :
Multiple Choice
Which of the following not part of a : 2043788
Multiple Choice
-
Which of the following is not part of a method's signature?
- The method's return type
- The method's name
- The data types of the method's parameters
- The order of the method's parameters
-
The location of an object specifies:
- the center of the object on the screen.
- the upper left corner of the object.
- the upper left corner of the bounding box for the object.
- the lower right corner of the bounding box for the object.
-
The lifetime of a parameter is:
- the time that method where it is declare is responding to a particular message.
- the lifetime of the object which is sent the message where the parameter is declared.
- the entire lifetime of the main method.
- from the first time that message is sent until the last time that message is sent within the program.
-
Which of the following is not true about local variables.
- Local variables model objects which are needed temporarily to carry out the task of a method.
- Local variables have a scope of the method in which they are declared.
- A local variable must be assigned a value or reference before it is used.
- The lifetime of a local variable declared in a method is the lifetime of the instance of that class.
-
The purpose of which method is to change the value of an instance variable during the lifetime of the instance variable?
- constructor
- mutator
- accessor
- assignment operator
-
Which of the following is not true about primitive data types?
- A primitive data type is not an object.
- You can not pass messages to a primitive data type.
- You create a new instance of a primitive data type using the keyword new.
- The names of the primitive data types are keywords.
-
The term method overloading is defined as:
- providing in a message more actual parameters than it has formal parmeters.
- making a method more than one task to accomplish.
- having more than one method in a class with the same name but different parameter lists.
- providing in a message fewer actual parameters than it has formal parameters.
-
Which of the following is the correct way to specify the fully qualified name for the Java built-in color to model green.
- Java.AWT.Color.GREEN
- java.awt.Color.GREEN.
- java.awt.color.green
- java.awt.Color.green
-
Which of the following properly implements the parameterized constructor which will create a balloon of the specified color and default size in the center of the screen?
- public Balloon (Color aColor{
_balloon = new Ellipse(aColor);
}
- private Balloon (Color aColor{
_balloon = new Ellipse(aColor);
}
- public Balloon(Color aColor) {
Ellipse = new _balloon(aColor);
}
- private Balloon(Color aColor) {
Ellipse = new _balloon(aColor);
}
-
Which of the following deflate methods properly implement the deflate method of Ballon.
- public deflate {
int w, h;
w = getWidth();
h = getHeight();
setWidth(w/2);
setHeight(h/4);
}
- public deflate {
int w, h;
w = _ballon.getWidth();
h = _ballon.getHeight();
_ballon.setWidth(w/2);
_ballon.setHeight(h/4);
}
- private deflate {
int w, h;
w = getWidth();
h = getHeight();
setWidth(w/2);
setHeight(h/4);
}
- private deflate {
int w, h;
w = _ballon.getWidth();
h = _ballon.getHeight();
_ballon.setWidth(w/2);
_ballon.setHeight(h/4);
}
Solution
5 (1 Ratings )
Related Answers