Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Introduction to Java
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Related Services

Bookmark and Share
Lecture Comments (11)

1 answer

Last reply by: Professor Quayle
Sun Apr 26, 2015 11:51 PM

Post by Akarsh Hemrajani on April 24, 2015

Sir, I believe the Gridworld class has been scrapped and Computer Science A labs have been introduced(for 2015). So will any lectures be following on the same?

1 answer

Last reply by: Professor Quayle
Tue Sep 16, 2014 1:11 PM

Post by Riya Karia on September 13, 2014

Professor,
Can you cast 'd' to 'float' ??
And then will i be 3.14159??

Thanks.


1 answer

Last reply by: Professor Quayle
Mon Sep 23, 2013 12:45 AM

Post by Larry wang on September 16, 2013

Professor, on this lesson binary,hex,dec, oct are missing. They are part of AP subsets, correct.

2 answers

Last reply by: Larry wang
Sun Sep 8, 2013 12:10 PM

Post by Larry wang on September 6, 2013

Professor, I think you may have skipped mentioning about "round-off errors nuances" and "rounding of floating point numbers to the nearest integer".

1 answer

Last reply by: Maxwell Zhao
Mon Jul 25, 2016 1:20 PM

Post by Geoffrey Clarion on May 26, 2013

Does the test cover the difference between bits and bytes? and other binary stuff?

Types, Variables, & Arithmetic Operators

  • AP Java Subset includes three primitive types: int, double, and boolean
  • A variable is a memory location that can store a value
  • A final variable, or constant, cannot change its value once it is assigned
  • There are five arithmetic operators: +, -, *, /, %
  • Assignment is done with the = operator
  • There are five compound assignment operators: +=, -=, *=, /=, %=
  • The increment operator ++ adds one; the decrement operator -- subtracts one

Types, Variables, & Arithmetic Operators

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

  • Intro 0:00
  • Roadmap 0:11
  • Primitive Data Types 0:37
    • Int
    • Double
    • Boolean
  • Variables 4:04
    • Declaring a Variable
    • Assigning a Value
    • Declaring and Assigning on the Same Line
  • Casting 7:00
    • Mixing Types
    • Automatic Casting
  • Find Variables - Constants 9:21
    • Final Variables
    • Constants Written in All Capitals
  • Arithmetic Operators 11:59
    • Five Arithmetic Operators
    • Result Depends on Type of Operands
  • Assignment Operators 14:59
    • Compound Assignment Operators
    • Examples
  • Increment / Decrement Operators 17:08
    • Add 1 (++)
    • Subtracts 1 (--)
  • Summary 21:41