ANSWERS {LATEST UPDATE}
An advantage of composition is the fact that we can sometimes reuse
classes that we have already written, instead of having to design and write
new classes. - ✔✔True
In Java a variable must...
a) zeroed before it can be used
b) be normalized before it can be used
c) be deleted before it can be used
d) be initialized before it can be used
e) None of the above - ✔✔Answer: e): None of the above
If "declared before it can be used" is an option choice, choose that instead
of e)...
In Java class members are declared with the keyword ______
a) static
b) global
,c) local
d) void - ✔✔Answer: a) static
Method overloading distinguishes between methods based on _____.
a) number of lines of code
b) use of loops
c) none of these
d) argument count only - ✔✔Answer: c) none of these
During what activity do we directly analyze the language pf the problem to
identify objects, their attributes and their behaviors
a) class outlining
b) none of these
c) noun/verb analysis
d) problem description
e) use case diagramming - ✔✔Answer: c) noun/verb analysis
Immediately after the object's variables are initialized _________
a) the object is destroyed
b) the object is suspended
c) a constructor is called
d) the object is ready for use
, e) none of these - ✔✔Answer: c) a constructor is called
Constructor is called immediately after an object is created. It is responsible
for initializing the object's variables. Constructors are special methods with
the same name as the class, and they are automatically invoked when an
object is instantiated using the new keyword.
Every Java program consists of at least one _____.
a) class definition
b) none of these
c) while loops
d) condition
e) System.out.println statement. - ✔✔Answer: a) class definition
In Java, a class definition starts with the class keyword followed by the
class name. For example:
public class HelloWorld {
// Class body
}
Which of the following is/are true about arrays? Choose all that apply.
a) the elements of an array are accessed by an integer index