Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. public class FactionNames {
  2. public enum Faction {AMITY, ABNEGATION, DAUNTLESS, ERUDITE, CANDOR};
  3. }
  4.  
  5. public Dauntless(String f, String l, int a, int ag, int end, Faction d) {
  6. super(f, l, a, d);
  7. if (ag >= 0 && ag <= 10) {
  8. this.agility = ag;
  9. } else {
  10. this.agility = 0;
  11. }
  12. if (end >= 0 && end <= 10) {
  13. this.endurance = end;
  14. } else {
  15. this.endurance = 0;
  16. }
  17. }
  18.  
  19. D:DocumentsGoogle DriveHomework1331
  20. Test.java:3: error: cannot find symbol
  21. Faction test;
  22. ^
  23. symbol: class Faction
  24. location: class Test
  25. Test.java:4: error: cannot find symbol
  26. test = Faction.DAUNTLESS;
  27. ^
  28. symbol: variable Faction
  29. location: class Test
  30. 2 errors
  31.  
  32. public class Test {
  33. public static void main(String[] args) {
  34. Faction test;
  35. test = Faction.DAUNTLESS;
  36. Dauntless joe = new Dauntless("Joseph", "Hooper", 20, 5, 3, test);
  37. Dauntless vik = new Dauntless("Victoria", "Ward", 19, 6, 2, test);
  38. Dauntless winner;
  39. winner = joe.battle(vik);
  40. System.out.println(winner);
  41.  
  42. }
  43. }
  44.  
  45. public class FactionNames {
  46. public enum Faction {AMITY, ABNEGATION, DAUNTLESS, ERUDITE, CANDOR};
  47. }
  48.  
  49. import com.example.FactionNames.Faction;
  50.  
  51. FactionNames.Faction test = FactionNames.Faction.DAUNTLESS;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement