Here, we will simulate a competition between two characters with the benefit of loops and methods.
Prepare a numeric variable to represent the health or energy level of game character 1. 'full' amount of energy
Prepare a numeric variable to represent the health or energy level of game character 2. Set its value to the ’full’ amount of energy
public class Main
{
public static void main(String[] args) {
System.out.println("Hello World");
int h1=100;
int h2=h1;
}
}
Comments
Leave a comment