I was trying to get this java program to return 2
. Why can't I type wait()
; in main
to do this?
I have an unrelated constructor (to this task of returning 2), and I've tried making an object in main to make it work but that didn't help.
Would a related constructor or method help? Do I have to initialize variables at the top of the class to accomplish this every time? Thanks for the help