First steps: Structure of your first source file

This is what a class file ought to look like when you take your first steps writing java programs: public class YourAppNameHere { public static void main(String[] args) { new YourAppNameHere().go(); } private String iAmAField; void go() { System.out.println("Your code goes here!"); } void someOtherMethod() { // You can call this method from 'go' with: someOtherMethod() iAmAField = "Hello, World!"; } } In particular, copy/paste the main() method verbatim and don’t touch it. If you need access to...

2 minute(s) read