day 3 notes - File Foo.java public class Foo(class name...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
File: Foo.java public class Foo (class name) { public static void main (method name) (String args[]){ System.out (class owner) .print (method) (“hello, world.”); } (method decloration) } (Access control: 2 levels, -Public, Anyone can use -Private, only available to things in the same file) Foo.java > compile: javac Foo.java File name > Foo.class (file that contains byte code)>run: java Foo class name (java runtime environment) >running program String literal: Sequence of charaters inside double quotes (must be on a single line) Ex. “Hi mom” / “1234” / “@#$!” To add a double quote use \” (Ex. “\”Hi mom\””) To add a line break use \n (Ex. “Hi \n mom”) To add a backslash use \\ To add a tab use \+ System.out.println (“…”) <-this adds a line after the print Memory diagram X (represents data) type -> Saved as: Binary Every variable has: Name –Tells where something is Type – How to translate binary into something more useful Value – The “something more useful”
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

day 3 notes - File Foo.java public class Foo(class name...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online