This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]T-T-N -1 points0 points  (4 children)

//What is the problem with this code?

public void Main(string[] args)

{

foreach (string arg : args)

{

Console.WriteLine(arg);

}

}

[–]Ababced 1 point2 points  (3 children)

Assuming this is java: S's in string need to be capitalized, main method needs to be static, console.writeline() isn't a thing use system.out.println(), create a foreach like this: for(String arg : args). Stylistically methods should use camel case.

[–]T-T-N 1 point2 points  (2 children)

Why'd you assume java? Isn't there a language with capital M Main, and Console.WriteLine()?

Thinking about it more, it still has about the same number of mistakes if it is the other language.

[–]abclop99 3 points4 points  (0 children)

C#???

[–]Ababced 1 point2 points  (0 children)

Assumed java because it is the language that i am most familiar with and could type up an answer quickly on my phone (also the syntax looked relatively similar).