Question: You have the following variable defined: Based on attack, we want to figure out what type the attack is weak against and strong against. Create
You have the following variable defined:
![public class AttackComparison { } public static void main(String[] args) { String](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1706/2/5/5/10265b362fe17b851706255100952.jpg)
Based on attack, we want to figure out what type the attack is weak against and strong against. Create a series of if/else-if/else statements to print the following message on the command window:

Change the value of the variable attack to “Fire” and "Grass" to see what it will print out next. Here is the following relationship between the three attack types:
● Water: weak against grass, strong against fire
● Fire: weak against water, strong against grass
● Grass: weak against fire, strong against water
To compare two Strings, should we use == or equals()?
public class AttackComparison { } public static void main(String[] args) { String attack = "Water"; }
Step by Step Solution
3.42 Rating (161 Votes )
There are 3 Steps involved in it
Based on the information provided and the code snippet you need to add a series of ifelseifelse stat... View full answer
Get step-by-step solutions from verified subject matter experts
