cannot find symbol error when using "extends"

I'm learning java inheritence and access control, but I'm not understanding "extends" correctly.  I have two very basic classes in two separate files:
[code
class Baseball6 {

private String city;
protected String state;
private int centerField;
protected int leftField;
public int rightField;

Baseball6(String in1, String in2, int in3, int in4, int in5){
city = in1;
state = in2;
centerField = in3;
leftField = in4;
rightField = in5;
}
}
/code]
and then:
[code
class ParkPlayers {

private String name;
public String team;
protected int year;

public static void main(String[] arguments) {
Baseball6 wrigley = new Baseball6("Chicago", "Illinois", 390, 345, 395);

System.out.println("Wrigley Field is in " + wrigley.state);
System.out.println("Left field is " + wrigley.leftField + "feet.");
}
}
/code]

when I compile ParkPlayers as listed above, everything is fine.  But if I put:

class ParkPlayers extends Baseball6

I get the error:

ParkPlayers.java:2: cannot find symbol
symbol  : constructor Baseball6()
location: class Baseball6
class ParkPlayers extends Baseball6{
^
1 error

So I guess I don't understand.  I've researched the issue and can't seem to find the simplistic answer I'm looking for.  Any explanation of what I'm doing wrong would be greatly appreciated.

Thanks!
17haat17Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozlevanonCommented:
The message is:
symbol  : constructor Baseball6()
This appears because the compiler tries to find an empty constructor (i.e. a constructor without any arguments) in class Baseball6. The compiler does this because your class ParkPlayers has no explicit constructor defined, and so java uses an empty constructor by default.
In order to create a new ParkPlayers object, java has to call this empty constructor, but since ParkPlayers extends Baseball6, when its constructor is called, it must call the super class constructor, namely Baseball6's empty constructor. However, Baseball6 has no empty constructor.
To fix this you must do one of two:
1. Define an empty constructor in Baseball6
2. Define a constructor in ParkPlayers which accepts the exact same arguments as the one in Baseball6: (String in1, String in2, int in3, int in4, int in5)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
17haat17Author Commented:
Thank you.  I followed suggestion 1, and that worked perfectly.  Funny, none of that information you provided was explained in the book I'm using....but it's obviously critical.  They just show classes extending classes extending classes.  Even their own examples don't compile.  Thanks again!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.