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 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 Question PointConstructors are called like any other method. TrueFalseClear selectionQuestion Question PointThe default constructor executes when an object is instantiated and initialized using an existing object. TrueFalseClear selectionQuestion Question PointThe method finalize automatically executes when the class object goes out of scope. TrueFalseClear selectionQuestion Question PointMysteryClassfirst: intsecond: double;MysteryClassMysteryClassintMysteryClassdouble;MysteryClassint doublesetDataint double: voidgetFirst: intgetSecond: doubledoubleFirst: intsquareSecond: doubleprint: voidequalsMysteryClass: booleanmakeCopyMysteryClass: voidgetCopy:MysteryClass According to the UML class diagram in the accompanying figure, which method is public and doesnt return anything? getCopy print equalsMysteryClass doubleFirstQuestion Question PointIn shallow copying, each reference variable refers to its own object. TrueFalseClear selectionQuestion Question PointGiven the declaration public class MyClass private int x; public void print System.out.printlnx x; private void setXint y x y; MyClass myObject new MyClass;The following statement is legal.myObject.setX; TrueFalseClear selectionQuestion Question PointConstructors have the same name as the member methods data members class packageQuestion Question PointMysteryClassfirst: intsecond: double;MysteryClassMysteryClassintMysteryClassdouble;MysteryClassint doublesetDataint double: voidgetFirst: intgetSecond: doubledoubleFirst: intsquareSecond: doubleprint: voidequalsMysteryClass: booleanmakeCopyMysteryClass: voidgetCopy:MysteryClass According to the UML class diagram in the accompanying figure, which of the following is a data member? MysteryClass print second getFirstQuestion Question PointMysteryClassfirst: intsecond: double;MysteryClassMysteryClassintMysteryClassdouble;MysteryClassint doublesetDataint double: voidgetFirst: intgetSecond: doubledoubleFirst: intsquareSecond: doubleprint: voidequalsMysteryClass: booleanmakeCopyMysteryClass: voidgetCopy:MysteryClass Which of the following would be a default constructor for the class MysteryClass shown in the accompanying figure? public MysteryClass setData; public MysteryClass setData; public MysteryClass setData; private MysteryClass setData; Question Question PointA mutator method of a class changes the values of the data members of the class. TrueFalseClear selectionQuestion Question PointWhich of the following words indicates an objects reference to itself? this that public protectedQuestion Question 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 Question PointClass members consist of all of the following EXCEPT named constants variable declarations predefined methods methodsQuestion Question PointIf a member of a class is a private method, you can access it outside the class. TrueFalseClear selectionQuestion Question PointA class and its members can be described graphically using Unified Modeling Language UML notation. TrueFalseClear selectionQuestion Question PointIn copying, each reference variable refers to its own object. shallow deep method objectQuestion Question PointSuppose that Book is class with two instance variablesname 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 BookString n int num public Book public BookBook b public copyBookString n int numQuestion Question PointThe methods of a class must be public. TrueFalseClear selectionQuestion Question PointThe nonstatic 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
