Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Objects Object-Oriented Programming Fields

Morten Hauge
Morten Hauge
9,240 Points

Error: Unexpected Symbol, can't compile.

I am getting the following errors:

Invader.cs(2,1): error CS1514: Unexpected symbol `}', expecting `.' or `{'                                                                                                                                            
Invader.cs(2,0): error CS1525: Unexpected symbol `}'                                                                                                                                                                  
Map.cs(2,1): error CS1514: Unexpected symbol `}', expecting `.' or `{'                                                                                                                                                
Map.cs(2,0): error CS1525: Unexpected symbol `}'                                                                                                                                                                      
Path.cs(2,1): error CS1514: Unexpected symbol `}', expecting `.' or `{'                                                                                                                                               
Path.cs(2,0): error CS1525: Unexpected symbol `}'                                                                                                                                                                     
Tower.cs(2,1): error CS1514: Unexpected symbol `}', expecting `.' or `{'                                                                                                                                              
Tower.cs(2,0): error CS1525: Unexpected symbol `}'  

I'm not really sure where this is going wrong. This is the code used in all of the above except for Map.cs

namespace TreehouseDefense
}
    class nameOfClass (e.g. Tower)
    {

    }
}

Map.cs looks like this:

namespace TreehouseDefense
}
    class Map
    {
        public int Width;
        public int Height;
    }
}

1 Answer

Morten Hauge
Morten Hauge
9,240 Points

Figured it out a minute after posting. My first curly brace was flipped the wrong way, changing that fixed it right up. I'll just leave this here, because people are bound to make the same mistake.