My first legit program :3 a pretty big and complicated one! Sigh... However I'm already having problems. Let me give you some background. For now I am simply logging a bunch of ships and their stats. I started out making each ship (like AdvHvgCruiser, below) a class of it's own. It worked great, but then I could not for the life of me remember why I did that instead of making them objects. I saved that project but reformatted it into this... And now I'm having problems
Here's what I have in this class:
import stocharactertracker.ships.Ships; (all of the variables are declared and set default in Ships)
public class FedCruiser extends Ships {
public FedCruiser() {
this.shipType = "Cruiser";
this.shipFaction = "Federation";
this.cruiserSpecial = true; }
(This is all fine, following is where the problem is)
FedCruiser AdvHvyCruiser = new FedCruiser() {
this.shipName = "Advanced Heavy Cruiser";
..... (A ton more declarations..) } }
In the object I get "illegal start of type... Identifier expected"
I don't know why .-.
Please, explain and give a solution.should I switch bal to the classes idea?
Thank you for your time ^.^