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 trialHassan Wattar
1,166 Pointserror CS1520
i keep on getting this error even though their is no wrong thing in my code, here is my code: namespace TreehouseDefense { class Point { public readonly int X; public readonly int Y;
public point(int x, int y)
{
X = x;
Y = y;
}
}
}
and here is the compiler error:
mcs -out:TreehouseDefense.exe *.cs && mono TreehouseDefense.exe point.cs(8,10): error CS1520: Class, struct, or interface method must have a return type Complination failed: 1 error(s), 0 warnings
4 Answers
Dale Severude
Full Stack JavaScript Techdegree Graduate 71,350 PointsHi Hassan,
You are missing a curly bracket at the end of your file. }
Hassan Wattar
1,166 Pointsok thx
Hassan Wattar
1,166 Pointsthat isn't the problem but thanks for helping
tommy graffam
2,300 PointsHey there,
I know this is a bit old but the problem is that when you declared
public point(int x, int y)
it has a lowercase p and it should be upper case like so:
public Point(int x, int y)