Question: Question 1 1 PointWhen does the method finalize execute? When the class object is created At the start of every program At the end of

Question 11 PointWhen does the method finalize execute? When the class object is created At the start of every program At the end of every program When the class object goes out of scopeQuestion 2Question 21 PointConstructors are called like any other method. TrueFalseClear selectionQuestion 3Question 31 PointThe default constructor executes when an object is instantiated and initialized using an existing object. TrueFalseClear selectionQuestion 4Question 41 PointThe method finalize automatically executes when the class object goes out of scope. TrueFalseClear selectionQuestion 5Question 51 PointMysteryClass-first: int-second: double;+MysteryClass()+MysteryClass(int)+MysteryClass(double);+MysteryClass(int, double)+setData(int, double): void+getFirst(): int+getSecond(): double+doubleFirst(): int+squareSecond(): double+print(): void+equals(MysteryClass): boolean+makeCopy(MysteryClass): void+getCopy():MysteryClass According to the UML class diagram in the accompanying figure, which method is public and doesnt return anything? getCopy() print() equals(MysteryClass) doubleFirst()Question 6Question 61 PointIn shallow copying, each reference variable refers to its own object. TrueFalseClear selectionQuestion 7Question 71 PointGiven the declaration public class MyClass{ private int x; public void print(){ System.out.println("x ="+ x); } private void setX(int y){ x = y; }}MyClass myObject = new MyClass();The following statement is legal.myObject.setX(10); TrueFalseClear selectionQuestion 8Question 81 PointConstructors have the same name as the ____. member methods data members class packageQuestion 9Question 91 PointMysteryClass-first: int-second: double;+MysteryClass()+MysteryClass(int)+MysteryClass(double);+MysteryClass(int, double)+setData(int, double): void+getFirst(): int+getSecond(): double+doubleFirst(): int+squareSecond(): double+print(): void+equals(MysteryClass): boolean+makeCopy(MysteryClass): void+getCopy():MysteryClass According to the UML class diagram in the accompanying figure, which of the following is a data member? MysteryClass print() second getFirstQuestion 10Question 101 PointMysteryClass-first: int-second: double;+MysteryClass()+MysteryClass(int)+MysteryClass(double);+MysteryClass(int, double)+setData(int, double): void+getFirst(): int+getSecond(): double+doubleFirst(): int+squareSecond(): double+print(): void+equals(MysteryClass): boolean+makeCopy(MysteryClass): void+getCopy():MysteryClass Which of the following would be a default constructor for the class MysteryClass shown in the accompanying figure? public MysteryClass(){ setData(0,0.0); } public MysteryClass(0,0.0){ setData(); } public MysteryClass(0){ setData(0,0.0); } private MysteryClass(10){ setData(); }Question 11Question 111 PointA mutator method of a class changes the values of the data members of the class. TrueFalseClear selectionQuestion 12Question 121 PointWhich of the following words indicates an objects reference to itself? this that public protectedQuestion 13Question 131 PointWhich of the following is used to allocate memory for the instance variables of an object of a class? the reserved word public the reserved word static the operator new the operator +Question 14Question 141 PointClass members consist of all of the following EXCEPT ____. named constants variable declarations pre-defined methods methodsQuestion 15Question 151 PointIf a member of a class is a private method, you can access it outside the class. TrueFalseClear selectionQuestion 16Question 161 PointA class and its members can be described graphically using Unified Modeling Language (UML) notation. TrueFalseClear selectionQuestion 17Question 171 PointIn ____ copying, each reference variable refers to its own object. shallow deep method objectQuestion 18Question 181 PointSuppose that Book is class with two instance variables-name of type String and numOfBooks of type int. Which of the following would be appropriate syntax for the heading of a copy constructor for the class called Book? public Book(String n, int num) public Book() public Book(Book b) public copyBook(String n, int num)Question 19Question 191 PointThe methods of a class must be public. TrueFalseClear selectionQuestion 20Question 201 PointThe non-static methods of a class are called instance methods. True

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!