Help me with object and method | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help me with object and method

Hi, i'm new in c# and now i'm lost. I don't know how to call an object which is from another method but in the same class, here the codes but i cropped because it's too long. https://code.sololearn.com/cP4ynC3tsOAK/?ref=app

13th Nov 2019, 2:42 PM
Sca
Sca - avatar
2 Answers
+ 1
I would change input(): public static Headphone input(){ //read input return new Headphone(a,b,c,d); } Inside main: Headphone hea = input(); now you can call info(): hea.info();
13th Nov 2019, 3:23 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Thank you, it worked
13th Nov 2019, 4:13 PM
Sca
Sca - avatar