W7003 The Basics

From Coder Merlin
Revision as of 22:16, 20 November 2019 by Chukwuemeka-tinashe (talk | contribs) (Created page with "== First Steps == * Emacs and Java * mkdir ~/AP-Practice * Within this directory, mkdir Hello, World * Create a new file, HelloWorld.java ** Names matter - the public class na...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

First Steps[edit]

  • Emacs and Java
  • mkdir ~/AP-Practice
  • Within this directory, mkdir Hello, World
  • Create a new file, HelloWorld.java
    • Names matter - the public class name MUST match the file name
  • Compile with javac
  • An executable must have an entry point which is a public, static function named main, accepting a single argument, an array of strings.
  • Execute with java

Short Cuts[edit]

  • Compilation and Execution can be combined
  • All of this can occur within emacs
  • Emacs shortcut and up arrow


Static Typing[edit]

  • Java is statically typed
  • Variables must be declared before they can be used, including the type