SlideShare a Scribd company logo
1 of 2
Download to read offline
Need uml diagram for this class please
public class GameItem {
private String name;
private int id;
private int strengthModifier;
private int speedModifier;
private int intelligenceModifier;
public GameItem(String name, int id, int strengthModifier, int speedModifier, int
intelligenceModifier) {
this.name = name;
this.id = id;
this.strengthModifier = strengthModifier;
this.speedModifier = speedModifier;
this.intelligenceModifier = intelligenceModifier;
}
public String getName() {
return name;
}
public int getId() {
return id;
}
public int getStrengthModifier() {
return strengthModifier;
}
public int getSpeedModifier() {
return speedModifier;
}
public int getIntelligenceModifier() {
return intelligenceModifier;
}
public void Comparison(GameItem c){
System.out.println("Item 1:ttItem 2:");
System.out.println(this.strengthModifier + "t |t" + c.strengthModifier);
System.out.println(this.speedModifier+ "t |t" + c.speedModifier);
System.out.println(this.intelligenceModifier + "t |t" + c.intelligenceModifier);
}
public boolean equals(GameItem other) {
return strengthModifier == other.strengthModifier && speedModifier == other.speedModifier
&& intelligenceModifier == other.intelligenceModifier;
}
// Declare a method that checks if two GameItems are duplicates
public boolean isDuplicate(GameItem other) {
return name.equals(other.name) && id == other.id && equals(other);
}
// Declare a method that creates a copy of a GameItem
public GameItem copy() {
return new GameItem(this.name, this.id, this.strengthModifier, this.speedModifier,
this.intelligenceModifier);
}
@Override
public String toString() {
return "GameItem{" + "name=" + name + ", id=" + id + ", strengthModifier=" +
strengthModifier + ", speedModifier=" + speedModifier + ", intelligenceModifier=" +
intelligenceModifier + '}';
}
}

More Related Content

Similar to Need uml diagram for this class please public class GameItem { pr.pdf

So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
arihantgiftgallery
 
I received answers to 2 App requests and paid. The JAVA Apps are not.docx
I received answers to 2 App requests and paid. The JAVA Apps are not.docxI received answers to 2 App requests and paid. The JAVA Apps are not.docx
I received answers to 2 App requests and paid. The JAVA Apps are not.docx
walthamcoretta
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
AroraRajinder1
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
anwarsadath111
 
I really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdfI really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdf
aggarwalshoppe14
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
udit652068
 
Automobile.javapublic class Automobile {    Declaring instan.pdf
Automobile.javapublic class Automobile {    Declaring instan.pdfAutomobile.javapublic class Automobile {    Declaring instan.pdf
Automobile.javapublic class Automobile {    Declaring instan.pdf
anitasahani11
 
I really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdfI really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdf
aggarwalshoppe14
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
lakshmijewellery
 

Similar to Need uml diagram for this class please public class GameItem { pr.pdf (20)

So Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdfSo Far I have these two classes but I need help with my persontest c.pdf
So Far I have these two classes but I need help with my persontest c.pdf
 
I received answers to 2 App requests and paid. The JAVA Apps are not.docx
I received answers to 2 App requests and paid. The JAVA Apps are not.docxI received answers to 2 App requests and paid. The JAVA Apps are not.docx
I received answers to 2 App requests and paid. The JAVA Apps are not.docx
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
 
I really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdfI really need some help if I have this right so far. PLEASE CHANG.pdf
I really need some help if I have this right so far. PLEASE CHANG.pdf
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
 
Automobile.javapublic class Automobile {    Declaring instan.pdf
Automobile.javapublic class Automobile {    Declaring instan.pdfAutomobile.javapublic class Automobile {    Declaring instan.pdf
Automobile.javapublic class Automobile {    Declaring instan.pdf
 
I really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdfI really need some help if I have this right so far. Please Resub.pdf
I really need some help if I have this right so far. Please Resub.pdf
 
Mobile Game and Application with J2ME - Collision Detection
Mobile Gameand Application withJ2ME  - Collision DetectionMobile Gameand Application withJ2ME  - Collision Detection
Mobile Game and Application with J2ME - Collision Detection
 
Mobile Game and Application with J2ME
Mobile Gameand Application with J2MEMobile Gameand Application with J2ME
Mobile Game and Application with J2ME
 
Creating a Facebook Clone - Part XX.pdf
Creating a Facebook Clone - Part XX.pdfCreating a Facebook Clone - Part XX.pdf
Creating a Facebook Clone - Part XX.pdf
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
 
Creating a Facebook Clone - Part XX - Transcript.pdf
Creating a Facebook Clone - Part XX - Transcript.pdfCreating a Facebook Clone - Part XX - Transcript.pdf
Creating a Facebook Clone - Part XX - Transcript.pdf
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Getting Started with the Amazon GameOn API - Peter Heinrich
Getting Started with the Amazon GameOn API - Peter HeinrichGetting Started with the Amazon GameOn API - Peter Heinrich
Getting Started with the Amazon GameOn API - Peter Heinrich
 
Design pattern - part 1
Design pattern - part 1Design pattern - part 1
Design pattern - part 1
 
Design pattern - part 3
Design pattern - part 3Design pattern - part 3
Design pattern - part 3
 
06slide.ppt
06slide.ppt06slide.ppt
06slide.ppt
 
a data driven game object system
a data driven game object systema data driven game object system
a data driven game object system
 
Flappy bird
Flappy birdFlappy bird
Flappy bird
 

More from aarzooabd

Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdfThirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
aarzooabd
 

More from aarzooabd (20)

Which of the following approaches is recommended to help users view a.pdf
Which of the following approaches is recommended to help users view a.pdfWhich of the following approaches is recommended to help users view a.pdf
Which of the following approaches is recommended to help users view a.pdf
 
What is the purpose of the assembler program- Group of answer choices.pdf
What is the purpose of the assembler program- Group of answer choices.pdfWhat is the purpose of the assembler program- Group of answer choices.pdf
What is the purpose of the assembler program- Group of answer choices.pdf
 
Using putty in Terminal- please write a code Create a country sub.pdf
Using putty in Terminal- please write a code      Create a country sub.pdfUsing putty in Terminal- please write a code      Create a country sub.pdf
Using putty in Terminal- please write a code Create a country sub.pdf
 
West MI Corporation owns 4-000-000 shares of stock in East MI Corporat.pdf
West MI Corporation owns 4-000-000 shares of stock in East MI Corporat.pdfWest MI Corporation owns 4-000-000 shares of stock in East MI Corporat.pdf
West MI Corporation owns 4-000-000 shares of stock in East MI Corporat.pdf
 
Using your own words- explain the difference between internal and exte.pdf
Using your own words- explain the difference between internal and exte.pdfUsing your own words- explain the difference between internal and exte.pdf
Using your own words- explain the difference between internal and exte.pdf
 
Unida Systems has 32 million shares outstanding trading for $ 10 per s.pdf
Unida Systems has 32 million shares outstanding trading for $ 10 per s.pdfUnida Systems has 32 million shares outstanding trading for $ 10 per s.pdf
Unida Systems has 32 million shares outstanding trading for $ 10 per s.pdf
 
Use the following diagram and information to answer the next question.pdf
Use the following diagram and information to answer the next question.pdfUse the following diagram and information to answer the next question.pdf
Use the following diagram and information to answer the next question.pdf
 
The workers' union at a particular university is quite strong- About 9.pdf
The workers' union at a particular university is quite strong- About 9.pdfThe workers' union at a particular university is quite strong- About 9.pdf
The workers' union at a particular university is quite strong- About 9.pdf
 
Two computers are connected together through their serial ports and Hy.pdf
Two computers are connected together through their serial ports and Hy.pdfTwo computers are connected together through their serial ports and Hy.pdf
Two computers are connected together through their serial ports and Hy.pdf
 
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdfThirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
Thirty years ago- Clarkln was a small city (about 70-000 residents) th.pdf
 
The griffins from mythology are real! It has been discovered that 3 re.pdf
The griffins from mythology are real! It has been discovered that 3 re.pdfThe griffins from mythology are real! It has been discovered that 3 re.pdf
The griffins from mythology are real! It has been discovered that 3 re.pdf
 
The Taylors agreed to make monthly payments on a mortgage of $145-000.pdf
The Taylors agreed to make monthly payments on a mortgage of $145-000.pdfThe Taylors agreed to make monthly payments on a mortgage of $145-000.pdf
The Taylors agreed to make monthly payments on a mortgage of $145-000.pdf
 
The following code is a function to solicit three three integers from.pdf
The following code is a function to solicit three three integers from.pdfThe following code is a function to solicit three three integers from.pdf
The following code is a function to solicit three three integers from.pdf
 
The economy of Country A grows at a rate of 1-5 percent per year- The.pdf
The economy of Country A grows at a rate of 1-5 percent per year- The.pdfThe economy of Country A grows at a rate of 1-5 percent per year- The.pdf
The economy of Country A grows at a rate of 1-5 percent per year- The.pdf
 
Text and Garner reading from readings list- a- Darwin believed that th.pdf
Text and Garner reading from readings list- a- Darwin believed that th.pdfText and Garner reading from readings list- a- Darwin believed that th.pdf
Text and Garner reading from readings list- a- Darwin believed that th.pdf
 
If you grow cells that are just about to enter S phase in media contai.pdf
If you grow cells that are just about to enter S phase in media contai.pdfIf you grow cells that are just about to enter S phase in media contai.pdf
If you grow cells that are just about to enter S phase in media contai.pdf
 
Ida Sidha Karya Company is a family-owned company located in the villa.pdf
Ida Sidha Karya Company is a family-owned company located in the villa.pdfIda Sidha Karya Company is a family-owned company located in the villa.pdf
Ida Sidha Karya Company is a family-owned company located in the villa.pdf
 
2- The search for immunity to SARS-CoV-2 involves finding people who h.pdf
2- The search for immunity to SARS-CoV-2 involves finding people who h.pdf2- The search for immunity to SARS-CoV-2 involves finding people who h.pdf
2- The search for immunity to SARS-CoV-2 involves finding people who h.pdf
 
Dichlorodifluoromethane (freon-12) is a common refrigerant that is als.pdf
Dichlorodifluoromethane (freon-12) is a common refrigerant that is als.pdfDichlorodifluoromethane (freon-12) is a common refrigerant that is als.pdf
Dichlorodifluoromethane (freon-12) is a common refrigerant that is als.pdf
 
I- Describe the kind of information that is required to model system r.pdf
I- Describe the kind of information that is required to model system r.pdfI- Describe the kind of information that is required to model system r.pdf
I- Describe the kind of information that is required to model system r.pdf
 

Recently uploaded

Neurulation and the formation of the neural tube
Neurulation and the formation of the neural tubeNeurulation and the formation of the neural tube
Neurulation and the formation of the neural tube
SaadHumayun7
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
17thcssbs2
 

Recently uploaded (20)

size separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceuticssize separation d pharm 1st year pharmaceutics
size separation d pharm 1st year pharmaceutics
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
The Ultimate Guide to Social Media Marketing in 2024.pdf
The Ultimate Guide to Social Media Marketing in 2024.pdfThe Ultimate Guide to Social Media Marketing in 2024.pdf
The Ultimate Guide to Social Media Marketing in 2024.pdf
 
Mbaye_Astou.Education Civica_Human Rights.pptx
Mbaye_Astou.Education Civica_Human Rights.pptxMbaye_Astou.Education Civica_Human Rights.pptx
Mbaye_Astou.Education Civica_Human Rights.pptx
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
Basic Civil Engineering notes on Transportation Engineering, Modes of Transpo...
 
The Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational ResourcesThe Benefits and Challenges of Open Educational Resources
The Benefits and Challenges of Open Educational Resources
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
Essential Safety precautions during monsoon season
Essential Safety precautions during monsoon seasonEssential Safety precautions during monsoon season
Essential Safety precautions during monsoon season
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 
....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf....................Muslim-Law notes.pdf
....................Muslim-Law notes.pdf
 
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
Exploring Gemini AI and Integration with MuleSoft | MuleSoft Mysore Meetup #45
 
philosophy and it's principles based on the life
philosophy and it's principles based on the lifephilosophy and it's principles based on the life
philosophy and it's principles based on the life
 
Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024Capitol Tech Univ Doctoral Presentation -May 2024
Capitol Tech Univ Doctoral Presentation -May 2024
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT VẬT LÝ 2024 - TỪ CÁC TRƯỜNG, TRƯ...
 
Neurulation and the formation of the neural tube
Neurulation and the formation of the neural tubeNeurulation and the formation of the neural tube
Neurulation and the formation of the neural tube
 
IATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdffIATP How-to Foreign Travel May 2024.pdff
IATP How-to Foreign Travel May 2024.pdff
 

Need uml diagram for this class please public class GameItem { pr.pdf

  • 1. Need uml diagram for this class please public class GameItem { private String name; private int id; private int strengthModifier; private int speedModifier; private int intelligenceModifier; public GameItem(String name, int id, int strengthModifier, int speedModifier, int intelligenceModifier) { this.name = name; this.id = id; this.strengthModifier = strengthModifier; this.speedModifier = speedModifier; this.intelligenceModifier = intelligenceModifier; } public String getName() { return name; } public int getId() { return id; } public int getStrengthModifier() { return strengthModifier; } public int getSpeedModifier() { return speedModifier; } public int getIntelligenceModifier() { return intelligenceModifier; } public void Comparison(GameItem c){ System.out.println("Item 1:ttItem 2:"); System.out.println(this.strengthModifier + "t |t" + c.strengthModifier); System.out.println(this.speedModifier+ "t |t" + c.speedModifier); System.out.println(this.intelligenceModifier + "t |t" + c.intelligenceModifier); }
  • 2. public boolean equals(GameItem other) { return strengthModifier == other.strengthModifier && speedModifier == other.speedModifier && intelligenceModifier == other.intelligenceModifier; } // Declare a method that checks if two GameItems are duplicates public boolean isDuplicate(GameItem other) { return name.equals(other.name) && id == other.id && equals(other); } // Declare a method that creates a copy of a GameItem public GameItem copy() { return new GameItem(this.name, this.id, this.strengthModifier, this.speedModifier, this.intelligenceModifier); } @Override public String toString() { return "GameItem{" + "name=" + name + ", id=" + id + ", strengthModifier=" + strengthModifier + ", speedModifier=" + speedModifier + ", intelligenceModifier=" + intelligenceModifier + '}'; } }