quiz 4

.docx

School

Clayton State University *

*We aren’t endorsed by this school

Course

1000

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

9

Uploaded by CaptainKomodoDragon3151

Report
The key word  this  is the name of a reference variable that an object can use to refer to itself. Question options: True False on An instance of a class does not have to exist in order for values to be stored in a class's static fields. Question options: True False on A class's static methods do not operate on the fields that belong to any instance of the class. Question options: True False on If you write a  toString  method for a class, Java will automatically call the method any time you concatenate an object of the class with a string. Question options: True False on When an object is passed as an argument, it is actually a reference to the object that is passed. Question options: True False on Both instance fields and instance methods are associated with a specific instance of a class, and they cannot be used until an instance of the class is created. Question options: True False on A single copy of a class's static field is shared by all instances of the class. Question options:
True False on When an object reference is passed to a method, the method may change the values in the object. Question options: True False on If you write a  toString   method to display the contents of an object,   object1 , for a class,  Class1 , then the following two statements are equivalent: System.out.println(object1); System.out.println(object1.toString()); Question options: True False on The only limitation that static methods have is ________. Question options: A)  they must be declared outside of the class B)  they cannot refer to nonstatic members of the class C)  they can only be called from static members of the class D)  they can refer only to nonstatic members of the class on Static methods can only operate on ________ fields. Question options: A)  instance B)  local
C)  global D)  static on When you make a copy of the aggregate object and of the objects that it references, ________. Question options: A)  a compiler error will occur B)  you are performing a nested copy C)  you are performing a shallow copy D)  you are performing a deep copy on A deep copy of an object ________. Question options: A)  is an operation that copies an aggregate object and all the objects that it references B)  is always a private method C)  is a bogus term and means nothing D)  is an assignment of that object to another object on The JVM periodically performs the ________ process to remove unreferenced objects from memory. Question options: A)  memory sweeping B)  memory shuffling
C)  system restore D)  garbage collection on When the  this  variable is used to call a constructor ________. Question options: A)  it must be the first statement in the constructor making the call B)  it can be anywhere in the constructor making the call C)  it must be the last statement in the constructor making the call D)  None of these. You cannot use the  this  variable in a constructor call. on When a reference variable is passed as an argument to a method ________. Question options: A)  the method becomes a static method B)  the method has access to the object that the variable references C)  a copy of the variable's value is passed into the method's parameter D)  the program terminates on When a method's return type is a class, what is actually returned to the calling program? Question options: A)  an object of that class B)  a reference to an object of that class C)  the values in the object that the method accessed
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help