Java File - Where Can You Put Code
It seems like a simple answer: anywhere! But, there is a caveat. All executable statements, so your logic, etc., must be placed within methods. If you try to put them directly in the class body, you will get an error. However, you can still put variables in the class body, and they will be accessible from within methods.
ByteBrawl
0