• Post Reply Bookmark Topic Watch Topic
  • New Topic

ParseException

 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm testing this method:

with this test:

I've 2 Qs:
1) in ParseException's constructor, it says:


thanks in advance
[ January 07, 2005: Message edited by: miguel lisboa ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Miguel,

I don't see any questions here. What did you want to ask?
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

when i edited i also deleted Qs...
Q #1 how can i use the 2nd param from parseException constructor? looks like any int will do the job...

Q#2 is it correct to set to null objs i dont need any more, like i did?
thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#1: The only purpose of this parameter is to provide a return value for the ParseException.getErrorOffset() method. That method just exists to provide informaion to code that catches the exception about where the error occurred. In your case, there'e no obvious way to get a sensible value, so I'd just use "0", meaning the beginning. Using any other value would be misleading.

#2: It's not incorrect, but there's little point -- the variable goes out of scope on the next line, which is pretty much the same thing.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#2: It's not incorrect, but there's little point -- the variable goes out of scope on the next line, which is pretty much the same thing.

of course
thanks a lot
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!