C
C#3y 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
Steak3y ago
are you assuming to set username at a user in the list?
Musluk
MuslukOP3y ago
yes
Steak
Steak3y ago
bukan gitu gan caranya are you familiar with arrays? u can do users[0].Username = any
Musluk
MuslukOP3y ago
like this?
Steak
Steak3y ago
set the object first then print later dont set at the same time
Musluk
MuslukOP3y ago
i got you but i want to add it to the list and act on various commands with it not array
Steak
Steak3y 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
MuslukOP3y ago
I want to move the data in X method to Y method
Steak
Steak3y ago
u are looking for parameters? in the Y(string _username) <-- u can do this passing 'arguements' in the parameter
Musluk
MuslukOP3y ago
then how can i deal with it
Musluk
MuslukOP3y ago
there must be some value here, right?
Steak
Steak3y 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
MuslukOP3y ago
you're right it's my fault
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server