Advertisement
476179

HelloWorld.java

Sep 19th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. package lessons;
  2.  
  3. //this is my first program
  4. //
  5. // sept 18, 2019
  6. // Computer Science
  7. //these are single line comments
  8.  
  9. /*
  10. * this is a
  11. * multi line
  12. * comment
  13. */
  14.  
  15. // jvm looks for the class to find the main method to find rthe code and then runs whats in mainM
  16. //this marks beginning of a class, it is a keyword and starts a class, the line below is 'class headder'
  17. public class HelloWorld
  18. {
  19.  
  20. //public is access specifier, the line below is called 'main method'
  21. public static void main(String[] args)
  22. { //system is a class, out is a member of object, inside parentheses is an argument, inside quotes is a sting literal
  23. System.out.println("Hello World!");
  24. }
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement