Question
A) Which is an antonym (word or term that means the opposite) of abstract? 1. low-level 2. encapsulated 3. expensive 4. hirsute 5. concrete B)
A) Which is an antonym (word or term that means the opposite) of "abstract"?
1. low-level 2. encapsulated 3. expensive 4. hirsute 5. concrete
B) Which of the following statements is true of constructors in Java?
1. Every class must contain code that defines a constructor 2. A class may have only one constructor 3. toString() is coded inside a constructor 4. All constructors are inherited from Object 5. Java compilers provide no-argument constructors unless other constructors are coded, in which case the programmer must code a no-argument constructor if one is needed
C) Which of these statements is true of instance variables in Java?
1. Objects define the names of instance variables 2. Classes specify the value of instance variables, unless they are finals 3. Java does not allow instance variables 4. Objects can hold the values of instance variables 5. All instance variables are finals
D) Which statement is true of getters and/or setters?
1. setters are usually private 2. getters are also called accessors 3. getters are also called mutators 4. setters are also called accessors 5. getters are usually private
E) Suppose I have a class called Student, and another called Course. Course contains the following code:
Student mary = new Student();
This line of code is an example of
1. inheritance 2. composition 3. overriding 4. subclassing 5. null pointer exception
F) How many Strings are created in memory when this code executes? Note that the question asks how many Strings are *created,* not how many are still in memory afterwards.
String s1 = "Godzilla";
String s2 = "Godzilla";
String s3 = s2;
1. 0 2. 1 3. 2 4. 3 5. 5
G) How many Strings are created in memory when this code executes?
String s1 = "Godzilla";
String s2 = new String("Godzilla");
String s3 = s2;
1. 0 2. 1 3. 2 4. 3 5. 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started