Hello, I'm getting a few errors in my code can anyone help thanks.
Player.java:10: error: invalid method declaration; return type required
displayFileContents("roster1.txt");
^
Player.java:10: error: illegal start of type
displayFileContents("roster1.txt");
^
Player.java:11: error: invalid method declaration; return type required
displayFileContents("roster2.txt");
^
Player.java:11: error: illegal start of type
displayFileContents("roster2.txt");
^
4 errors
>
public class Player {
private String name = "";
private double attackStat = 0.0;
private double blockStat = 0.0;
public static Roster openRosterFile() throws IOException;
displayFileContents("roster1.txt");
displayFileContents("roster2.txt");
public Player(String initName, double initAttackStat, double initBlockStat){
name = intName;
attackStat = AttackStat;
blockStat = BlockStat;
}
public String getName()
{
return name;
}
public double getAttackStat()
{
return attackStat;
}
public double getBlockStat()
{
return blockStat;
}
public void setName(String s)
{
name = s;
}
public void setAttackStat(double x)
{
attackStat = x;
}
public void setBlockStat(double x)
{
blockStat = x;
}
public void printPlayerInfo()
{
System.out.println(name + "(attack =" + " " + attackStat + " " + "block =" + " " + blockStat);
}
public static void main(String args[]);
public void addPlayer(String playersName, double initAttackStat, double initBlockStat) {
}
public int countPlayers() {
return Player;
}
public void getPlayerByName() {
}
public void PrintTopAttackers () {
}
public double PrintAllBlockers() {
}
public void printAllPlayers(double newBlockStat) {
}
}
Player.java:10: error: invalid method declaration; return type required
displayFileContents("roster1.txt");
^
Player.java:10: error: illegal start of type
displayFileContents("roster1.txt");
^
Player.java:11: error: invalid method declaration; return type required
displayFileContents("roster2.txt");
^
Player.java:11: error: illegal start of type
displayFileContents("roster2.txt");
^
4 errors
>
public class Player {
private String name = "";
private double attackStat = 0.0;
private double blockStat = 0.0;
public static Roster openRosterFile() throws IOException;
displayFileContents("roster1.txt");
displayFileContents("roster2.txt");
public Player(String initName, double initAttackStat, double initBlockStat){
name = intName;
attackStat = AttackStat;
blockStat = BlockStat;
}
public String getName()
{
return name;
}
public double getAttackStat()
{
return attackStat;
}
public double getBlockStat()
{
return blockStat;
}
public void setName(String s)
{
name = s;
}
public void setAttackStat(double x)
{
attackStat = x;
}
public void setBlockStat(double x)
{
blockStat = x;
}
public void printPlayerInfo()
{
System.out.println(name + "(attack =" + " " + attackStat + " " + "block =" + " " + blockStat);
}
public static void main(String args[]);
public void addPlayer(String playersName, double initAttackStat, double initBlockStat) {
}
public int countPlayers() {
return Player;
}
public void getPlayerByName() {
}
public void PrintTopAttackers () {
}
public double PrintAllBlockers() {
}
public void printAllPlayers(double newBlockStat) {
}
}