Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If the following is from the method section of a UML diagram, which of the following TRUE? + equals(object2:Stock): boolean A) This is a private

image text in transcribed
If the following is from the method section of a UML diagram, which of the following TRUE? + equals(object2:Stock): boolean A) This is a private method that receives two objects from the Stock class and returns a B.) This is a public method that accepts a Stock object as its argument and returns a boolean C) This is a private method that returns a boolean value. D) This is a public method that returns a Stock object. To compare two objects in a class: A) use the == operator, e.g. object 1 == object2 B) write a method to do a byte-by-byte compare of the two objects C) write an equals method that will make a field by field compare of the two objects D) Since objects consist of several fields, you cannot compare them If object1 and object2 are objects of the same class, to make object 2 a copy of object A) assign object1 to object2, such as object2 = object1; B) write a copy method that will make a field by field copy of object1 data members into c data members C) use the Java copy method that is a part of the Java language D) use the default constructor to create object2 with object1 data members A deep copy of an object: A) is an assignment of that object to another object B) is an operation that copies an aggregate object, and all the objects it references C) is a bogus term, it has no meaning D) is always a private method The term for the relationship created by object aggregation is: A) has a B) is a C) Sub-class object D) Inner class If the this variable is used to call a constructor A) a compiler error will result, if it is not the first statement of the constructor B) a compiler error will result, if it is the first statement of the constructor C) nothing will happen D) the this variable cannot be used as a constructor call When a field is declared static, there will be: A) a copy of the field in each class object B) only one copy of the field in memory C) a copy of the field for each static method in the class D) only two copies of the field in memory

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Technologies And Applications

Authors: Zongmin Ma

1st Edition

1599041219, 978-1599041216

More Books

Students also viewed these Databases questions