❔ ✅ Prints System.Func`1[System.Int32] instead of actual int.
I'm trying to return a private field member variable and instead of giving me the actual integer value it gives me the thing in the title. Please help.
11 Replies
Please share your code
This is in program.cs (the default class)
This is food.cs (the class I created)
and even with the name my problem is that
it returns a func something string
i changed it a bit to test it with the name
Note that your output is "My food meat heals...", but the code has "The food meat heals...". Are you sure you're running your latest code?
yeah i know i changed it a bit
This is still what it gives out with a string now
for the last code i gave u
That's not helpful. Please make sure that the code and error you give us actually match up
Alright
Here, let me give you the previous code i used
for the picture
Program.cs
Anyway,
getName
it a method. You need to call it: getName()
Yeah
thats why
im dumb
i got confused because it seemed to be working
It didnt give me an error but because i didnt call it it just gave me what type it returned
my bad im stupid
thanks
👍
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.