Unexpected symbol, can’t I detect it?

Asked

Viewed 58 times

0

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ProgramacaoParalela
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Pressione ENTER para iniciar");
            Console.ReadLine();

            // Invocar os métodos que vamos executar
            Parallel.Invoke(
            new Action(exibirDias),
            new Action(exibirMeses),
            );

            // Aguardar a continuação do programa
            Console.WriteLine("\nO método Main foi encerrado. Tecle Enter");
            Console.ReadLine();
        }

        static void exibirDias()
        {
            string[] diasArray = { "Segunda", "Terça", "Quarta","Quinta", "Sexta", "Sábado", "Domingo" };
            foreach (string dia in diasArray)
            {
            Console.WriteLine("Dia da semana: {0}", dia);
            Thread.Sleep(500);
            }
        }

        static void exibirMeses()
        {
            string[] messArray = { "Jan", "Fev", "Mar", "Abr","Mai", "Jun", "Jul",
                                   "Ago", "Set", "Out", "Nov", "Dec" };

            foreach (string mes in messArray)
            {
            Console.WriteLine("Mês : {0}", mes);
            Thread.Sleep(500);
            }
        }

    }

}

In this code above I am not able to see where my ) that the compiler accuses with the following message:

main.Cs(22,11): error CS1525: Unexpected Symbol `)'

1 answer

0


Remove the vigula from this line new Action(exibirMeses),

Place public static void Main(string[] args)

  • Thank you! Beginner error.

  • @If Fenix resolved could accept m single answer :)

  • was hoping to spend the 5 minutes! Done

Browser other questions tagged

You are not signed in. Login or sign up in order to post.