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 trialFAUSTO CAMACHO
4,008 PointsWhy am I greeting an error cs1519 if I'm supose to add curly bracer to the method?
using System;
class Program
{
// YOUR CODE HERE: Define a method named Spell. Remember to use the
// "static" and "void" keywords: "static void Spell" (without quotes)...
static void Spell();
{
Console.WriteLine("c");
Console.WriteLine("a");
Console.WriteLine("t");
}
static void Main(string[] args)
{
Spell();
}
}
ñ
1 Answer
Chris Rafferty
3,011 PointsThe spell method you've declared has a semi colon at the end of it, that's why you're getting your problem.
When declaring a method you don't need a semi colon, you just need the argument brackets '()' followed by the curly brackets '{}' which you wrap your method code in. When calling the method you then follow it with a semi colon, just like you correctly did in Main.