• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

help me

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


i got error msg:
exception in thread "main" java.lang.ArrayIndexOutOfBoundException:1000
Record.Save(Record.java:238)

how to fix it ya??

[ April 06, 2005: Message edited by: Silly Boy ]
[ April 06, 2005: Message edited by: Mark Spritzler ]
 
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Silly Boy:

i got error msg:
exception in thread "main" java.lang.NullPointerException
Record.Save(Record.java:238)

how to fix it ya??



Notice that the error message is referring to line #238, and that it's in your Save method of the Record class. Now, I don't know which line is 238 in your file, since you just posted the Save method, but once you figure that out, you're halfway there--the error will be on or near that line.

Second, the error is a NullPointerException. So head to the docs and take a look at what that means. I'm guessing that it's probably the second cause they list. So look for a case near line 238 where you're assigning something that might turn out to really be "null". It helps to ask yourself things like, "What is this line of code doing?" "Is it doing what I think it's doing?" "Are these variables and objects representing what I think they're representing?"

Third, I really didn't bother wading though your code too much because, well, it's kind of a mess. If you post your code with "CODE" tages around it, that will preserve the indenting, and make it a whole lot more readable.

Good luck ya??

- Jeff
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr. Boy,

Welcome to JavaRanch!

You may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. "Handles" aren't acceptable. You can change your display name here. Thanks!
 
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Silly Boy" -

You have got to be kidding here. Please read the JavaRanch FAQ, where you'll find a discussion on how to ask a question, including how to include only relevant portions of your code (not the whole thing), how to tell us what error you see, what you've done to try to fix it, and to clearly ask one or two relevant questions. You'll get a lot more willing help that way.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How did the error change from a NullPointerException to an ArrayIndexOutOfBoundsException.

As far the new error, maybe it is simple becausel your array does not have up to 1000 elements.

try to change



to have the "for" line say

for (x = 0; x < Record.length; x++) {

Mark
 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic