Quite new to Java so apologies if there's any wrong terminology or some simple mistakes here. I'm trying to create an object of a class (Player) in another class (Main), by calling a constructor method in Main (I declared the constructor in Player). I'm getting the 'cannot find symbol' error, which to me means that I've declared the variables outside of the scope of the constructor, but I really don't know. Here is the code:
Player:
public class Player {
public Player(String Name, int MA, int ST, String AG, String PA, String AV, int Cost, String Skills) {
Name = "BLANK";
MA = 0;
ST = 0;
AG = "1+";
PA = "1+";
AV = "1+";
Cost = 0;
Skills = "None";
} //Declares all class attributes as parameters for when a new object is created. Target numbers and skills are strings, simple numbers are integers
Main:
import java.util.Scanner;
//goals: select from teams, store player data in external files, allow roster editing, show recommended rosters
class Main {
public static void main(String[] args) {
Scanner Input = new Scanner(System.in); //scanner object called Input to allow input
System.out.println("BB2020 TEAM BUILDER");
Player NewPlayer = new Player("Human Lineman", 6, 3, "3+", "4+", "9+", 50, "None");
System.out.println(NewPlayer.Name);
}
}
Again sorry if this is a common or simple question, thanks for your help :)