Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming ›  Array Index Out Of Bounds Exception error
New Posts  All Forums:Forum Nav:

Array Index Out Of Bounds Exception error - Page 2

post #11 of 13
Grats! And an arrayList is basically an array that doesn't need a defined length. If it needs more memory allocated, it takes care of it for you. It can do a lot more as well. You should check out the documentation on it.
College Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-930 @ 4.2Ghz, Stable ASUS P6X58D-E EVGA GTX 460 SSC 1024MB & EVGA GTX 460 SC 1024MB OCZ Gold 6GB (3 x 2GB) 240-Pin DDR3 1600 
Hard DriveOptical DriveOSMonitor
Intel X25-M Mainstream 80GB SATA II SSD ASUS USB 2.0 External Slim DVD±R/RW Windows 7 Ultimate 64-Bit 3x SAMSUNG P2570HD Black 24.6" 4ms HDMI Widescreen 
KeyboardPowerCaseMouse
Eclipse Lite-Touch (Wired) CORSAIR 850HX Corsair 800D Razer Naga 
  hide details  
Reply
College Rig
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7-930 @ 4.2Ghz, Stable ASUS P6X58D-E EVGA GTX 460 SSC 1024MB & EVGA GTX 460 SC 1024MB OCZ Gold 6GB (3 x 2GB) 240-Pin DDR3 1600 
Hard DriveOptical DriveOSMonitor
Intel X25-M Mainstream 80GB SATA II SSD ASUS USB 2.0 External Slim DVD±R/RW Windows 7 Ultimate 64-Bit 3x SAMSUNG P2570HD Black 24.6" 4ms HDMI Widescreen 
KeyboardPowerCaseMouse
Eclipse Lite-Touch (Wired) CORSAIR 850HX Corsair 800D Razer Naga 
  hide details  
Reply
post #12 of 13
Thread Starter 
Quote:
Originally Posted by Satsukeshi View Post

Grats! And an arrayList is basically an array that doesn't need a defined length. If it needs more memory allocated, it takes care of it for you. It can do a lot more as well. You should check out the documentation on it.

Thanks! Yeah, if my Professor doesn't cover it in the next couple of sections I'll definitely look it up. Right now we're just doing some review from Computer Science 1 and I think then we're moving straight to exception handling. So there is a good chance I'll probably have to look it up.
Thanks for the tip. i appreciate it. smile.gif
Griever
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3570K ASUS P8Z77-V Deluxe MSI R7950 Twin Frozr 3GB Corsair Vengeance 16GB 1600Mhz 
Hard DriveCoolingOSMonitor
OCZ Vertex Plus 120GB Corsair h100 Windows 7 Professional Asus VS228H-P 21.5In 
KeyboardPowerCase
Razer Black Widow Ultimate Corsair AX850 NZXT Switch 810 White 
  hide details  
Reply
Griever
(14 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i5-3570K ASUS P8Z77-V Deluxe MSI R7950 Twin Frozr 3GB Corsair Vengeance 16GB 1600Mhz 
Hard DriveCoolingOSMonitor
OCZ Vertex Plus 120GB Corsair h100 Windows 7 Professional Asus VS228H-P 21.5In 
KeyboardPowerCase
Razer Black Widow Ultimate Corsair AX850 NZXT Switch 810 White 
  hide details  
Reply
post #13 of 13
Another suggestion: it won't make your program run any better but consider assigning 75 to a constant. It will make it easier to read and maintain the program. Declare it as:

public static final int MAX_BALLS = 75;

Place it in whichever class is most appropriate to be defining such a restriction. If other classes need to reference this constant, it would be referenced as "ClassName.MAX_BALLS".
     
CPUMotherboardGraphicsRAM
Intel Core i7-4770K Gigabyte G1.Sniper M5 EVGA GTX 780 SC Crucial Ballistix Sport 2 x 8GB 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Pro 256GB Seagate Barracuda 3TB Seagate Barracuda 4TB Asus BD-ROM 
CoolingOSMonitorKeyboard
Noctua NH-D14 Windows 8 Pro Dell U2713HM Ducky YOTD (MX Brown) 
PowerCaseMouseMouse Pad
SeaSonic SS-760XP2 Fractal Design Arc Mini Roccat Savu SteelSeries 9HD 
Audio
Beyerdynamic DT990 250 Ohm 
CPUMotherboardGraphicsRAM
AMD A6-3500 Asrock A75M HD 6530D Samsung 4GB DDR3 1600  
Hard DriveHard DriveHard DriveOptical Drive
Intel 320 80GB Samsung Spinpoint F4 2TB WD Caviar Green 3TB Sony BD-Rom 
CoolingOSMonitorKeyboard
Noctua NH-C12P SE14 Win 7 Professional 64-bit Samsung LN46C600 Lenovo N5902 
PowerCaseOther
Corsair CX430 Antec Veris Fusion HDHomeRun Prime 
CPUMotherboardGraphicsRAM
AMD Phenom II X3 B55 Asus M5A99X EVO Sapphire HD 7950 G.Skill 8GB DDR3 
Hard DriveOptical DriveCoolingMonitor
Samsung F3 1TB LG DVD-RW CM Hyper 212 Plus Dell U2312HM 
KeyboardPowerCaseMouse
Pink KBT Race (MX Blue) Lepa G700-MA Corsair 500R Razer Abyssus 
Mouse Pad
Razer Goliathus Speed 
  hide details  
Reply
     
CPUMotherboardGraphicsRAM
Intel Core i7-4770K Gigabyte G1.Sniper M5 EVGA GTX 780 SC Crucial Ballistix Sport 2 x 8GB 
Hard DriveHard DriveHard DriveOptical Drive
Samsung 840 Pro 256GB Seagate Barracuda 3TB Seagate Barracuda 4TB Asus BD-ROM 
CoolingOSMonitorKeyboard
Noctua NH-D14 Windows 8 Pro Dell U2713HM Ducky YOTD (MX Brown) 
PowerCaseMouseMouse Pad
SeaSonic SS-760XP2 Fractal Design Arc Mini Roccat Savu SteelSeries 9HD 
Audio
Beyerdynamic DT990 250 Ohm 
CPUMotherboardGraphicsRAM
AMD A6-3500 Asrock A75M HD 6530D Samsung 4GB DDR3 1600  
Hard DriveHard DriveHard DriveOptical Drive
Intel 320 80GB Samsung Spinpoint F4 2TB WD Caviar Green 3TB Sony BD-Rom 
CoolingOSMonitorKeyboard
Noctua NH-C12P SE14 Win 7 Professional 64-bit Samsung LN46C600 Lenovo N5902 
PowerCaseOther
Corsair CX430 Antec Veris Fusion HDHomeRun Prime 
CPUMotherboardGraphicsRAM
AMD Phenom II X3 B55 Asus M5A99X EVO Sapphire HD 7950 G.Skill 8GB DDR3 
Hard DriveOptical DriveCoolingMonitor
Samsung F3 1TB LG DVD-RW CM Hyper 212 Plus Dell U2312HM 
KeyboardPowerCaseMouse
Pink KBT Race (MX Blue) Lepa G700-MA Corsair 500R Razer Abyssus 
Mouse Pad
Razer Goliathus Speed 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming ›  Array Index Out Of Bounds Exception error