Examlex

Solved

Suppose the Class Message Is Partially Defined as Shown Below

question 9

Multiple Choice

Suppose the class Message is partially defined as shown below public class Message
{
Private String value;
Public Message(String initial)
{
Value = initial;
}
Public String getMessage()
{
Return value;
}
}
A subclass of Message, ExcitedMessage, is defined that will behave like Message, except that it will add two exclamation points to the end of the message. Sample code that uses ExcitedMessage is shown below.
ExcitedMessage greeting = new ExcitedMessage("Hello") ;
System.out.print(greeting.getMessage() ) ;
// will print "Hello!!"
Which ExcitedMessage constructor will give this behavior?


Definitions:

Stereotyping

The act of generalizing characteristics, traits, or behaviors to all members of a particular group, often leading to oversimplification or bias.

Foot-In-The-Door Technique

A persuasion strategy that involves getting a person to agree to a small request to increase the likelihood of agreeing to a larger request later.

Authority

The power or right to give orders, make decisions, and enforce obedience.

Social Identity

The portion of an individual's self-concept derived from perceived membership in a relevant social group, such as a national, religious, or occupational group.

Related Questions