1
CSCI 2010 Midterm Questions and Answers
(100% Correct Answers) Already Graded A+
What is an object? Ans: an instance of a class
What is a class? Ans: a blueprint for creating objects
What is a UML class diagram? Ans: a structural diagram that can be
© 2026 Assignment Expert
used to visually model the classes of a computer program, including
data members and functions
Guru01 - Stuvia
What is an instance variable? Ans: an object of a class where data is
stored
What is a method? Ans: a collection of instructions that perform a
specific task
What are the access modifiers? Ans: public - can be accessed from any
package.
private - only members of the same class can access.
protected - can be accessed by classes inside the package and
subclasses anywhere.
default - no access by classes or subclasses outside the package
What is the null constant? Ans: the absence of a value or a reference to
an object
, For Expert help and assignment handling,
2
A ______ method is a method that does not return a value. Ans: void
What does a method header contain? Ans: access modifier (public),
return type (void), name of the method (writeOutput), and the
parameter list in parenthesis
The _____ ______ contains a sequence of statements to execute when
the method is called, and must be surrounded by { and }. Ans: method
body
© 2026 Assignment Expert
A method can be defined to return a ______. Ans: value
When the method is called, the return value should be stored in a ______.
Guru01 - Stuvia
Ans: variable
Within a method definition, the keyword ______ refers to the object that is
performing the action specified by the method Ans: this
What is a local variable? Ans: a variable that is declared in the body of a
method
What is a parameter? Ans: blanks in a method
What is a argument? Ans: items passed into a method when it is invoked
What is an accessor method? Ans: a method that returns an instance
variable
What is a mutator method? Ans: a method that sets a value to an
instance variable