x
Info
x
Warning
x
Danger
 / 
 / 
 / 
Multiple Choice    Which of the following not part of a

Question : Multiple Choice    Which of the following not part of a : 2043788

Multiple Choice

  1.    Which of the following is not part of a method's signature?
    1.                The method's return type
    2.                The method's name
    3.                The data types of the method's parameters
    4.                The order of the method's parameters

 

  1.    The location of an object specifies:
    1.                the center of the object on the screen.
    2.                the upper left corner of the object.
    3.                the upper left corner of the bounding box for the object.
    4.                the lower right corner of the bounding box for the object.

  1.    The lifetime of a parameter is:
    1.                the time that method where it is declare is responding to a particular message.
    2.                the lifetime of the object which is sent the message where the parameter is declared.
    3.                the entire lifetime of the main method.
    4.                from the first time that message is sent until the last time that message is sent within the program.

 

  1.    Which of the following is not true about local variables.
    1.                Local variables model objects which are needed temporarily to carry out the task of a method.
    2.                Local variables have a scope of the method in which they are declared.
    3.                A local variable must be assigned a value or reference before it is used.
    4.                The lifetime of a local variable declared in a method is the lifetime of the instance of that class.
  2.    The purpose of which method is to change the value of an instance variable during the lifetime of the instance variable?
    1.                constructor
    2.                mutator
    3.                accessor
    4.                assignment operator

  1.    Which of the following is not true about primitive data types?
    1.                A primitive data type is not an object.
    2.                You can not pass messages to a primitive data type.
    3.                You create a new instance of a primitive data type using the keyword new.
    4.                The names of the primitive data types are keywords.

  1.    The term method overloading is defined as:
    1.                providing in a message more actual parameters than it has formal parmeters.
    2.                making a method more than one task to accomplish.
    3.                having more than one method in a class with the same name but different parameter lists.
    4.                providing in a message fewer actual parameters than it has formal parameters.

  1.    Which of the following is the correct way to specify the fully qualified name for the Java built-in color to model green.
    1.                Java.AWT.Color.GREEN
    2.                java.awt.Color.GREEN.
    3.                java.awt.color.green
    4.                java.awt.Color.green
  2.    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?
    1.                public Balloon (Color aColor{

_balloon = new Ellipse(aColor);

}

  1.                private Balloon (Color aColor{

_balloon = new Ellipse(aColor);

}

  1.                public Balloon(Color aColor) {

Ellipse = new _balloon(aColor);

}

  1.                private Balloon(Color aColor) {

Ellipse = new _balloon(aColor);

}

  1. Which of the following deflate methods properly implement the deflate method of Ballon.
    1.                public deflate {

int w, h;

w = getWidth();

h = getHeight();

setWidth(w/2);

setHeight(h/4);

}

  1.                public deflate {

int w, h;

w = _ballon.getWidth();

h = _ballon.getHeight();

_ballon.setWidth(w/2);

_ballon.setHeight(h/4);

}

  1.                private deflate {

int w, h;

w = getWidth();

h = getHeight();

setWidth(w/2);

setHeight(h/4);

}

  1.                private deflate {

int w, h;

w = _ballon.getWidth();

h = _ballon.getHeight();

_ballon.setWidth(w/2);

_ballon.setHeight(h/4);

}

Solution
5 (1 Ratings )

Solved
Computer Science 1 Year Ago 149 Views
This Question has Been Answered!
Unlimited Access Free
Explore More than 2 Million+
  • Textbook Solutions
  • Flashcards
  • Homework Answers
  • Documents
Signup for Instant Access!
Ask an Expert
Our Experts can answer your tough homework and study questions
154368 Computer Science Questions Answered!
Post a Question