Ich verwende Methoden in C#. Ich habe etwas zurückgegeben, aber der Compiler druckt nicht, was ich erwarte. Es wird gedruckt (system.string []). Ich weiß nicht warum. Bitte helfen Sie mir dabei. Compiler ist seltsam Wert in C#
class Program
{
static void Main(string[] args)
{
string[] sub = subjects();
Console.WriteLine(sub);
}
public static string[] subjects()
{
Console.WriteLine("Please Enter How many Subject Do you Want to input");
int limit = System.Convert.ToInt32(Console.ReadLine());
string[] Subjects = new string[limit];
for (int i = 0; i < limit; i++)
{
Console.WriteLine("Please Enter Subject Name " + i);
Subjects[i] = Console.ReadLine();
}
return Subjects;
}
}
Du siehst wirklich „was die Variable ist“, nicht ihr Inhalt. –