SyntaxFix
Write A Post
Hire A Developer
Questions
I am trying to get int x equal to 5 (as seen in the setNum() method) but when it prints it gives me 0.
To run the code in setNum you have to call it. If you don't call it, the default value is 0.
setNum
0