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# Basics Methods Method Parameters

error CS1514

When I try to use Static voic, I get error CS1514.

Program.cs
using System;

class Program
class Console
{
    static void Multiply()
    {
        Console.WriteLine(Multiply(2.5, 2));
        Console.WriteLine(Multiply(6, 7));
    }
    // YOUR CODE HERE: Define a method named Multiply. Remember
    // to use the "static" and "void" keywords: "static void
    // Multiply" (without quotes). Multiply should take two
    // "double" values as parameters.
    static double Add(double first, double second)
    {
        return first + second;
    }
    static double Subtract(double first, double second)
    {
        return first + second;

        static void Main(string[] args)
        {
            Multiply();
            // YOUR CODE HERE:
            // Call Multiply with two arguments: 2.5 and 2.
            // YOUR CODE HERE:
            // Call Multiply with two arguments: 6 and 7.
        }

1 Answer

I would suggest hitting the restart button on your challenge to get the default code back and work from there. It only wants you to create a multiply method, not an add and subtract one too. The mistake that stands out to me the most though is that your Main method is inside of your Subtract method brackets, and that should never happen. Also when you call Multiply from inside your Main method, you're not passing any arguments in, nor is your actual Multiply method receiving any parameters. It's a tough concept but just keep working at it!