Whats wrong with my code?

  • Thread starter Thread starter -Cubic-
  • Start date Start date
C

-Cubic-

Guest
Hi, I am very new to this and just started a class on C#. I made a code, but Visual Studio claims there are some errors, errors I dont know how to solve. This is the furthest I got, all other attempts have generated more errors than these 2.

I hope I posted this in the correct forum, sorry if I posted it in the wrong section.

My project is to make a method which is only accesable from within the own class, An integer that input parameter, a text string as the return value and at last I am gonna return the text together with the input parameter.

So here is my code:


namespace metodtesting
{
class Program
{
static void Main(string[] args);
{ <--- first error
class Test
{
public void PrintSomeThing(int nr)
{
Console.WriteLine(new Method1(nr));
}
private String Method1(int nr)
{
Convert.ToString("Some text " + nr.toString);
}

}
}
}
} <--- second error


And the errors I get are these:

1. Invalid token { in class, struct. or interface member declaration

2. Type or namespace definition, or en-of-file expected.

Continue reading...
 
Back
Top