Explanation of Solution
Program code:
MyCharacter.java
//define a class MyCharacter
public class MyCharacter
{
//define the class member variables
private String name;
private int health;
private int power;
//constructor
public MyCharacter()
{
}
//constructor
public MyCharacter(String n, int h, int p)
{
//initialize the variables
name = n;
health = h;
power = p;
}
//define the method getName()
public String getName()
{
//return the value of name
return name;
}
//define the method setName()
public void setName(String name)
{
//set the value of name
this.name = name;
}
//define the method getHealth()
public int getHealth()
{
//return the value of health
return health;
}
//define the method setHealth()
public void setHealth(int health)
{
//set the value of health
this.health = health;
}
//define the method getPower()
public int getPower()
{
//return the value of power
return power;
}
//define the method setPower()
public void setPower(int power)
{
//set the value of power
this.power = power;
}
}
Explanation:
The above snippet of code is used to create a class “MyCharacter”. In the code,
- Import the required header files.
- Define a class “MyCharacter”
- Declare the class variables “name”, “health” and “power”.
- Define the constructor “MyCharacter”.
- Set the values of variables “name”, “health” and “power”.
- Define the “getName()” method.
- Return the value of “name”.
- Define the “setName()” method...
Trending nowThis is a popular solution!
Chapter 3 Solutions
EBK JAVA PROGRAMMING
- make a screen capture showing the StegExpose resultsarrow_forwardWhich of the following is not one of the recommended criteria for strategic objectives? Multiple Choice a) realistic b) appropriate c) sustainable d) measurablearrow_forwardManagement innovations such as total quality, benchmarking, and business process reengineering always lead to sustainable competitive advantage because everyone else is doing them. a) True b) Falsearrow_forward
- Vision statements are more specific than strategic objectives. a) True b) Falsearrow_forwardThe three components of the __________ approach to corporate accounting include financial, environmental, and social performance measures. Multiple Choice a) stakeholder b) triple dimension c) triple bottom line d) triple efficiencyarrow_forwardCompetitors, as internal stakeholders, should be included in the stakeholder management consideration of a company and in its mission statement. a) True b) Falsearrow_forward
- At what level in the organization should the strategic management perspective be emphasized? Multiple Choice a) throughout the organization b) from the bottom up in an organization c) at the top of the organization d) at the middle of the organizationarrow_forwardA good manager can be flexible when it comes to sticking to the original plan; to get good results, the intended strategy has to become the realized strategy. a) True b) Falsearrow_forward________ tend to be quite enduring and seldom change. Multiple Choice a) Strategic objectives b) Vision statements c) Strategic plans d) Mission statementsarrow_forward
- The idea that organizations are not only accountable to stockholders but also to the community-at-large is known as social responsibility. a) True b) Falsearrow_forwardAmong the leaders needed for an effective strategic management process are ________, who, although they have little positional power and formal authority, generate their power through the conviction and clarity of their ideas. Multiple Choice a) executive leaders b) triple bottom line advocates c) internal networkers d) local line leadersarrow_forwardI would like to get help to resolve the following casearrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning