Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #904

Re: Help needed.

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.tele.dk!feed118.news.tele.dk!feed116.news.tele.dk!bofh.vszbr.cz!news.radio.cz!newsreader4.netcologne.de!news.netcologne.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Gene Wirchenko <genew@ocis.net>
Newsgroups comp.lang.java.help
Subject Re: Help needed.
Date Wed, 27 Jul 2011 11:33:34 -0700
Organization A noiseless patient Spider
Lines 29
Message-ID <lbm037ljlmg61pk5nsbf1e8ecuspt25njd@4ax.com> (permalink)
References <37f0537b-a064-4b12-9b6f-c104df52f4ba@k15g2000yqd.googlegroups.com> <j0nl7o$tpu$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Injection-Info mx04.eternal-september.org; posting-host="7Qrvczazr82YckO5XW8Vtw"; logging-data="6885"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/NgP76Vbr104qHCUzaFUmbL65PcpdGJCE="
X-Newsreader Forte Agent 4.2/32.1118
Cancel-Lock sha1:5ZVAvU2uxjHR9LgAYUjmavp01Ow=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:904

Show key headers only | View raw


On Tue, 26 Jul 2011 17:13:41 -0700, markspace <-@.> wrote:

>On 7/26/2011 3:47 PM, neil furnival wrote:
>> Exception in thread "main" java.lang.NullPointerException
>
>> reply = myScanner.findInLine(".").charAt(0);

>You should learn how to debug your own programs, it's an important part 
>of programming.
>
>My guess is in the line above the pattern "." was not found and 
>findInlIne() returned null:
>
>"If no such pattern is detected in the input up to the next line 
>separator, then null is returned"
>
><http://download.oracle.com/javase/6/docs/api/java/util/Scanner.html#findInLine%28java.util.regex.Pattern%29>
>
>I'll let you discover how to verify that this is indeed the problem, and 
>what to do about it.

     I will pass along the tip of breaking up a complex statement. The
statement is complex because you do not understand where the error is
coming from.  Doing so you would find that the .findInLine() is the
culprit.  Off to the docs mentioned by markspace and then bug-stomp.

Sincerely,

Gene Wirchenko

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Help needed. neil furnival <neil.furnival@googlemail.com> - 2011-07-26 15:47 -0700
  Re: Help needed. markspace <-@.> - 2011-07-26 17:13 -0700
    Re: Help needed. neil furnival <neil.furnival@googlemail.com> - 2011-07-27 01:49 -0700
      Re: Help needed. lewbloch <lewbloch@gmail.com> - 2011-07-28 08:50 -0700
        Re: Help needed. lewbloch <lewbloch@gmail.com> - 2011-07-30 16:19 -0700
    Re: Help needed. Gene Wirchenko <genew@ocis.net> - 2011-07-27 11:33 -0700
  Re: Help needed. Roedy Green <see_website@mindprod.com.invalid> - 2011-07-26 22:09 -0700

csiph-web