UPDATED QUESTIONS AND CORRECT
ANSWERS
The new operator:
(a) allocates memory
(b) is used to create an object of a class
(c) associates an object with a variable that names it.
(d) All of the above. - CORRECT ANSWER (c) associates an object with a variable
that names it.
A method that performs some action instead of returning a value is called a __________
method.
(a) null
(b) void
(c) public
(d) private - CORRECT ANSWER (b) void
The body of a method that returns a value must contain at least one _________ statement.
(a) void
(b) invocation
(c) throws
(d) return - CORRECT ANSWER (d) return
A variable whose meaning is confined to an object of a class is called:
(a) instance variable
(b) local variable
(c) global variable
(d) none of the above - CORRECT ANSWER (a) instance variable
, In Java, a block is delimited by:
(a) ( )
(b) /* */
(c) " "
(d) { } - CORRECT ANSWER (d) { }
The parameter this refers to
(a) instance variables
(b) local variables
(c) global variables
(d) the calling object - CORRECT ANSWER (d) the calling object
When the parameters in a method have the same as instance variables you can differentiate
them by using the _____ parameter.
(a) String
(b) hidden
(c) default
(d) this - CORRECT ANSWER (d) this
A program whose only task is to test a method is called a:
(a) driver program
(b) stub
(c) bottom-up test
(d) recursive method - CORRECT ANSWER (a) driver program
A set method is:
(a) an accessor method
(b) a mutator method