I don't really get how to create new methods for my code. Yesterday people told me it's got no body.
Didn't really understand anything when i did research. It's probably a quick fix : ]
I'm talking about the bubblesort method im trying to create
19 Replies
remove
;
after private void BubbleSort()
NAH AINT NO WAY
it works
i hate my life thank you xddd
well
i put the code in and stuff
right
but i can't use the method?
what method?
the bubble sort. i tried to send in a sc but my pc is dying
why can't u use it?
hey sorry my pc crashed
well, hover on the red line and read the error message
yeah it has no definition for bubblesort. but i don't get how to fix it :/
You defined bubble sort as a method on MainWindow
Please tell me what type is your variable
your method belongs to your current class, not List<int>
its in the screenshot
but writing it out of mainwindow just gives me 10000 error codes
no 1 said you need to write it out of mainwindow
oh i thought he meant that by that
u are trying to call BubbleSort() on an instance of List<int>
however your BubbleSort() method is defined in your
MainWindow
class
so you need to call it on an instance of MainWindow
, not List<int>
so write this.BubbleSort();
the this
keyword refers to the current instance of the current classokayokay
It's working but imma have to read into that more
thank you
well, you can look in links below to help you learn more fundamentals about C# $helloworld
Written interactive course https://learn.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/tutorials/
Videos https://dotnet.microsoft.com/learn/videos
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.