Well I'm a beginner and I would like to know how to display the array I made(It's an Integer array). I'm just trying to create a simple calculation program that accepts user input on which fighter they would like to pick, and how much money they would like to bet. Again, I'm just a beginner so no hate please.
public class Fighter {
private int health;
private int attack;
private int money;
int[] fighter={health,attack,money};
public Fighter(int h, int a, int m){
health=h;
attack=a;
money=m;
}
public int[] getFighter(){
return fighter;
}
}
*******END OF FIGHTER CLASS*****
import java.util.*;
public class FighterCreator {
public static void main(String[] args){
Fighter newFighter=new Fighter((int)(Math.random() * 701),
(int)(Math.random() * 39), 7000);
System.out.print(newFighter.getFighter());
}
}
When I run the code it just displays hexadecimal, can you guys please explain it in a way a beginner would understand, thanks.