Enter your Sign on user name and password.

Forgot password?
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 Java
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Related Services

Lecture Comments (9)

0 answers

Post by Roger Akembom on May 13, 2013

Is it possible to start off by writing the code instead of pre-writing the code? This will help students understand the process/steps more.

0 answers

Post by Ebrima K Drammeh on March 16, 2013

how can you print out the two faces of the dices(face1 and face2)?

0 answers

Post by Mohammad Nabeel on January 26, 2013

I understand most of the coding your using, but I can't see which part of your code tally's the number of times the same total is received by throwing two dice.

0 answers

Post by Dan Chernov on January 7, 2012

i have the same these two questions!! could you please help to understand?

2 answers

Last reply by: Sergio Gutierrez
Wed Nov 28, 2012 9:35 PM

Post by Lance Coon on November 5, 2011

I guess I just have one question about the rolldice example.

Why are you adding one plus the random number (up to 6)? that would mean you could get 7 as a roll? or are you already compensating for the 0 roll by adding 1 to the random number (up to but not including 6)?

1 answer

Last reply by: Sergio Gutierrez
Wed Nov 28, 2012 9:32 PM

Post by Dur Abuzaid on October 25, 2011

hello, in the rolldice example .
that mean all the index value or the elements are 0?
or the array start from index 0.


  • An Array is a Java variable object that can hold multiple values
  • An Array is similar to a table or grid of data
  • Values stored in Arrays are called “elements”
  • All elements are indexed with a numbering systems that starts with zero
  • Arrays can be one-dimensional lists, or two-dimensional grids of data


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
  • What is an Array? 0:08
    • Attributes of Array
  • Types of Arrays 1:10
    • Single-Dimensional
    • Two-Dimensional
  • How to Declare an Array 3:15
    • Declaring an Array: Single Dimension
    • Declaring an Array: Two Dimension
  • The Enhanced 'for' Statement 5:02
    • 'for' Statement
  • Passing Arrays to Methods 7:14
    • Pass by Value
    • Pass by Reference
  • Example 1: Simple Array 8:24
  • Example 2: Program Simulates Rolling Two Six-sided Dice 36,000 Times 9:54
  • Example 3: Application Roll Two Dice 14:49
  • Example 4: Program Totals Sales for Sales Staff and Products 17:24
  • Example 5: Application for Class Sales 21:08
  • Example 6: Card Class Represents a Playing Card 24:43
  • Example 7: Deck Class Represents a Deck of Playing Cards 26:36
  • Example 8: Card Shuffling and Dealing Application 30:35