Since I'm a total beginner I don't know much about C# yet.
I want to use the returned string from Method 1 in my main method.
Shouldn't I be able to use it since Method1 is public?
public string Method1() { Console.Write("Vorname: "); string vorname = Convert.ToString(Console.ReadLine()); Console.Write("Nachname: "); string nachname = Convert.ToString(Console.ReadLine()); Console.Write("Adresse: "); string adresse = Convert.ToString(Console.ReadLine()); string info = vorname + nachname + adresse; return (info); } static void Main(string[] args) { string dateipfad = @"C:\Users\kaihe\Documents\persönliche_informationen.txt"; AllMethods txtfileabfrage = new AllMethods(); txtfileabfrage.Method2(); AllMethods input = new AllMethods(); Console.WriteLine(info); File.WriteAllText(dateipfad, info); Console.ReadKey(); }