CSC 142 Final Exam | Questions and
Answers | Fall Update | 100% Correct ;
We keep mentioning the concept of scope., which of the following describes at best what the
scope of a local variable?
the entire java file.
inside the class, and inside every method.
inside the parentheses of a method signature.
the method in which the local variable is defined. - ANSWER>>the method in which the local
variable is defined.
It is highly recommended and for privacy and security, that in object-oriented programming to
make all of a class's
instance variables public
methods public
instance variables and methods public
instance variables private - ANSWER>>instance variables private
Let's take a look bac again to our House Catalogues analogy example. We can think of a class as
a design/blueprint that describes a given house and ________ are instantiated of that house
built from the blueprint.
attributes
methods
fields
objects - ANSWER>>objects
A SETTER method is a method that accepts a value from a class's instance variable and does not
change.
True
False - ANSWER>>False
The access specifier(public, private) is needed to control how the class may be accessed.
True
False - ANSWER>>True
, What do we call a group of related classes? In NetBeans for example, we do that to keep our
code organized.
archive
attachment
collection
package - ANSWER>>package
We invoke the key word new in order to?
create an object that represents a given class
assign a new variable in memory
completely create a new class
create a new Java file - ANSWER>>create an object that represents a given class
The private access specifier for class member (instance variable, method) specifies that the field
may can't be accessed by written code outside the class.
True
False - ANSWER>>True
In Java, a method
may have two parameters or more
must have at least one parameter variables.
never accepts parameter variables.
may have none or many parameter variables. - ANSWER>>may have none or many parameter
variables.
et's do some UML study, If you read the following method, what does it mean?
+ setTicektNumber(price:double) : void
a public method that accepts a double data type and does not return a value
a public field called TicketNumber that is designed as a double data type
a private field called TicketNumber that is designed as a double data type
a private method that accepts a double data type and does not return a value - ANSWER>>a
public method that accepts a double data type and does not return a value
A GET method is the one that saves a passed value in a class's field or somehow changed the
value of an instance variable .
True
False - ANSWER>>False
Answers | Fall Update | 100% Correct ;
We keep mentioning the concept of scope., which of the following describes at best what the
scope of a local variable?
the entire java file.
inside the class, and inside every method.
inside the parentheses of a method signature.
the method in which the local variable is defined. - ANSWER>>the method in which the local
variable is defined.
It is highly recommended and for privacy and security, that in object-oriented programming to
make all of a class's
instance variables public
methods public
instance variables and methods public
instance variables private - ANSWER>>instance variables private
Let's take a look bac again to our House Catalogues analogy example. We can think of a class as
a design/blueprint that describes a given house and ________ are instantiated of that house
built from the blueprint.
attributes
methods
fields
objects - ANSWER>>objects
A SETTER method is a method that accepts a value from a class's instance variable and does not
change.
True
False - ANSWER>>False
The access specifier(public, private) is needed to control how the class may be accessed.
True
False - ANSWER>>True
, What do we call a group of related classes? In NetBeans for example, we do that to keep our
code organized.
archive
attachment
collection
package - ANSWER>>package
We invoke the key word new in order to?
create an object that represents a given class
assign a new variable in memory
completely create a new class
create a new Java file - ANSWER>>create an object that represents a given class
The private access specifier for class member (instance variable, method) specifies that the field
may can't be accessed by written code outside the class.
True
False - ANSWER>>True
In Java, a method
may have two parameters or more
must have at least one parameter variables.
never accepts parameter variables.
may have none or many parameter variables. - ANSWER>>may have none or many parameter
variables.
et's do some UML study, If you read the following method, what does it mean?
+ setTicektNumber(price:double) : void
a public method that accepts a double data type and does not return a value
a public field called TicketNumber that is designed as a double data type
a private field called TicketNumber that is designed as a double data type
a private method that accepts a double data type and does not return a value - ANSWER>>a
public method that accepts a double data type and does not return a value
A GET method is the one that saves a passed value in a class's field or somehow changed the
value of an instance variable .
True
False - ANSWER>>False