Last active
February 13, 2022 13:31
-
-
Save jjfiv/03e809e04c6f4942329e918f41c758da to your computer and use it in GitHub Desktop.
CS201 First Java File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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