1 of 16

Slide Notes

DownloadGo Live

Click hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

Published on Dec 02, 2015

No Description

PRESENTATION OUTLINE

Understanding Java

Imran Kidwai & Ben Zusmann
Photo by htomari

Variables

  • Int (Integers)
  • Double (Decimals)
  • Boolean (True or False)
  • String (various inputs)
Photo by tj.blackwell

Variables

  • must be declared
  • local scope (in method)
  • assigned literals

Arithmetic Operators

  • add (+)
  • subtract (-)
  • multiply (*)
  • divide (/)
  • percent (%)
Photo by Wonderlane

Arithmetic Operators

  • * and /
  • %
  • + and -

String Concatenation

Combining multiple variables
Photo by Alesa Dam

newstring = "beginning Java " + "is fun!"

                 Output: Beginning Java is fun!               
Photo by djking

Comments

  • Start with //
  • Allow for non-programmable notes
Photo by @pach

Untitled Slide

Functions (Methods)

a routine that computes some value, given information
Photo by Reznicek111

FUNCTIONvALUE = FUNCTIONnAME(ARGUMENTlIST);

            MATH.FUNCTIONTYPE(ARGUMENT)           
Photo by alexcoitus

tYPES OF fUNCTIONS

  • abs (Absolute Value)
  • sqrt (square root)*
  • pow (exponentation)*
Photo by Tau Zero

sqrt-'double' variables

pow-two arguments

Photo by Waifer X

Java Scanner Object

  • allows run-time editing
  • found in Java API Package
  • java.util.Scanner
Photo by quinet

Input Statements

  • import statement
  • import java.util.Scanner
  • constructor
  • Scanner myScanner = new Scanner(Program.in)
Photo by flickrolf

Print vs Println

  • println-new line after
  • print-continues on line
  • \n-blank line at location
Photo by Cory Remjeske