• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 11 pages
Exam (elaborations)

Wgu C212 Marketing Study Exams Guide Questions And Answers Sure A.pdf

Document preview thumbnail
Preview 2 out of 11 pages

WGU C212 MARKETING STUDY EXAMS GUIDE QUESTIONS AND ANSWERS SURE A.pdf

Content preview

WGU C212 MARKETING STUDY EXAMS GUIDE
QUESTIONS AND ANSWERS SURE A+
✔✔Why does the call System.out.println(System.out); produce a result such as
java.io.PrintStream@7a84e4? - ✔✔Because the implementor of the PrintStream class
did not supply a toString method.

✔✔Will the following code fragment compile? Will it run? If not, what error is reported?

Object obj = "Hello";
System.out.println(obj.length()); - ✔✔The second line will not compile. The class Object
does not have a method length.

✔✔Will the following code fragment compile? Will it run? If not, what error is reported?

Object obj = "Who was the inventor of Java?";
Question q = (Question) obj;
q.display(); - ✔✔The code will compile, but the second line will throw a class cast
exception because Question is not a superclass of String.

✔✔Assuming that x is an object reference, what is the value of x instanceof Object?
(Answer). - ✔✔The value is false if x is null and true otherwise

, ✔✔When (and why) do you use the reserved word super? - ✔✔You can also use the
reserved word super to invoke a constructor of the superclass (as part of the constructor
chaining rules).
Constructor chaining: unless specified otherwise, the subclass constructor calls the
superclass constructor with no arguments. To
call a superclass constructor, use the super reserved word in the first statement of the
subclass constructor. The constructor of
a subclass can pass arguments to a superclass constructor, using the reserved word
super.

✔✔Assuming SavingsAccount is a subclass of BankAccount, which of the following
code fragments are valid in Java?
(a) BankAccount account = new SavingsAccount();
(b) SavingsAccount account2 = new BankAccount();
(c) BankAccount account = null;
(d) SavingsAccount account2 = account; - ✔✔(a) BankAccount account = new
SavingsAccount();

✔✔What is the purpose of the method toString in class java.lang.Object? - ✔✔Override
the toString method (and suppply your own version) to yield a string that describes the
object's state.

✔✔What is the purpose of the method equals in class java.lang.Object? - ✔✔The
equals method checks whether two objects have the same contents.

✔✔How do you check that two objects belong to the same class (even if you don't know
the name of the class)? - ✔✔Use getClass().

✔✔What is a simple rule of thumb for finding classes? - ✔✔Look for nouns in the
problem description.

✔✔What is a criterion of cohesion for a class's public interface? - ✔✔The public
interface of a class is cohesive if all of its features are related to the concept
that the class represents.

✔✔What is an immutable class? - ✔✔An immutable class has no mutator methods.

✔✔Why is it a good idea to minimize dependencies between classes? - ✔✔If a class
does not depend on another it is not affected by interface changes in the other class.

✔✔Is the substring method of the String class an accessor or a mutator? - ✔✔It's an
accessor -- calling substring doesn't modify the string on which the method is invoked.
In fact all
instance methods of the String class are accessors.

Document information

Uploaded on
July 14, 2026
Number of pages
11
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$16.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BOARDWALKer
3.4
(19)
Sold
162
Followers
6
Items
26749
Last sold
17 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions