C
C#2y ago
Musluk

data transfer between classes

I want to list 'uname' value in method X, to method Y i am new to oop
14 Replies
Steak
Steak2y ago
are you assuming to set username at a user in the list?
Musluk
Musluk2y ago
yes
Steak
Steak2y ago
bukan gitu gan caranya are you familiar with arrays? u can do users[0].Username = any
Musluk
Musluk2y ago
like this?
Steak
Steak2y ago
set the object first then print later dont set at the same time
Musluk
Musluk2y ago
i got you but i want to add it to the list and act on various commands with it not array
Steak
Steak2y ago
wait i dont quite understand what were u trying to accomplish here? add a new user to a list? edit an existing user in a list?
Musluk
Musluk2y ago
I want to move the data in X method to Y method
Steak
Steak2y ago
u are looking for parameters? in the Y(string _username) <-- u can do this passing 'arguements' in the parameter
Musluk
Musluk2y ago
then how can i deal with it
Musluk
Musluk2y ago
there must be some value here, right?
Steak
Steak2y ago
u can put string.Empty and ur title is pretty misleading this is not data transfer between classes most likely data transfer between methods
Musluk
Musluk2y ago
you're right it's my fault
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server