+ 1

First Code project from c# intermediate

I can't solve this problem. This is my code.and it has bug Is there someone helping me? using System; using System.Collections.Generic; namespace Code_Coach_Challenge { class Program { static void Main(string[] args) { string postText = Console.ReadLine(); Post post = new Post(); post.Text = postText; post.ShowPost(); } } class Post { private string text; //write a constructor here public Post(){ Console.WriteLine("New post"); } public void ShowPost() { Console.WriteLine("\n"+text); } //write a property for member text public string Text { get return text; set text= value; } } }

20th Mar 2024, 8:57 PM
mobina
mobina - avatar
3 RĂ©ponses
+ 5
public string Text { get {return text;} set {text= value;} }
20th Mar 2024, 11:49 PM
JaScript
JaScript - avatar
+ 4
mobina happy coding
21st Mar 2024, 8:10 AM
JaScript
JaScript - avatar
+ 2
Thank you so much .I was so tired 😅JaScript
21st Mar 2024, 1:28 AM
mobina
mobina - avatar