Travis1012's Profile User Rating: -----

Reputation: 36 Craftsman
Group:
Contributors
Active Posts:
222 (0.11 per day)
Joined:
05-August 09
Profile Views:
10,116
Last Active:
User is offline Sep 13 2014 07:23 PM
Currently:
Offline

Previous Fields

Country:
AU
OS Preference:
Who Cares
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
75

Latest Visitors

Icon   Travis1012 am now a MACS CT.

Posts I've Made

  1. In Topic: ANTLR - Getting my head around it

    Posted 13 Sep 2014

    Thanks. Wasn't sure on which section to post in. Seemed to fit in Android and Java as it was mostly a Java issue.
  2. In Topic: Finding equal numbers from array

    Posted 24 Jan 2014

    You are definately causing an ArrayIndexOutOfBounds error.

    When looking at your code specifically the lines:

    if(array3[i] == array3[i-1]){
    


    and

    }else if(array3[i] == array3[i+1]){
    


    I can see why an ArrayIndexOutOfBounds would occur.

    In the first iteration of the for loop i = 0. So array3[i] is referencing position 0 and array3[i-1] position -1 (Whoops! Can not index a position outside of the array, -1 does not exist). That is the first error.

    On the final iteration of the for loop something similar will happen. array3[i] will be the referencing the last position in the array i, and array3[i+1] will be indexing a position outside the array again. This is why you will be having these errors. Look over your code and try to attempt to rectify the errors. Not saying what I said will solve the entire problem you need to solve but should help to get you moving again.

My Information

Member Title:
D.I.C Head
Age:
24 years old
Birthday:
December 10, 1990
Gender:
Location:
Australia
Full Name:
Travis
Years Programming:
7
Programming Languages:
JAVA, PHP, HTML, JavaScript, C/C++, Perl, CSS, OpenGL

Contact Information

E-mail:
Private
Website URL:
Website URL  http://
Twitter:
trav1sk

Friends

Comments

Travis1012 has no profile comments yet. Why not say hello?