Skip to content

Instantly share code, notes, and snippets.

@jjfiv
Last active February 13, 2022 13:31
Show Gist options
  • Save jjfiv/03e809e04c6f4942329e918f41c758da to your computer and use it in GitHub Desktop.
Save jjfiv/03e809e04c6f4942329e918f41c758da to your computer and use it in GitHub Desktop.
CS201 First Java File
/**
* Every Java file must have a class defined in it!
* Notice that the name of this file is Welcome.java
* .. and we define class Welcome!
* .. that's super important to Java. It's picky like that.
*/
public class Welcome {
/**
* Don't change any details about the outside of this `main` function
* ... it needs to be precise!
* In VSCode, the Run|Debug buttons will disappear.
*/
public static void main(String[] args) {
// Print statements are a bit more verbose than Python.
// And single-line comments start with slashes, not hash-signs: #
System.out.println("Congratulations!");
System.out.println("You've installed Java!");
System.out.println("\tJava=" + System.getProperty("java.version"));
System.out.println("\tOS=" + System.getProperty("os.name"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment