+ 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
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();
+ 1
Thank you, it worked