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


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

Re: Help needed.

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!m18g2000vbl.googlegroups.com!not-for-mail
From neil furnival <neil.furnival@googlemail.com>
Newsgroups comp.lang.java.help
Subject Re: Help needed.
Date Wed, 27 Jul 2011 01:49:41 -0700 (PDT)
Organization http://groups.google.com
Lines 30
Message-ID <07461a44-6c77-4ecc-aa5b-84d8450d8f86@m18g2000vbl.googlegroups.com> (permalink)
References <37f0537b-a064-4b12-9b6f-c104df52f4ba@k15g2000yqd.googlegroups.com> <j0nl7o$tpu$1@dont-email.me>
NNTP-Posting-Host 81.96.101.169
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1311756582 20394 127.0.0.1 (27 Jul 2011 08:49:42 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Wed, 27 Jul 2011 08:49:42 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info m18g2000vbl.googlegroups.com; posting-host=81.96.101.169; posting-account=yyhTJAoAAADJq2v41KE9_xKCMWsTyOCT
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-Header-Order HUALESNKRC
X-HTTP-UserAgent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:903

Show key headers only | View raw


On Jul 27, 1:13 am, 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#f...>
>
> I'll let you discover how to verify that this is indeed the problem, and
> what to do about it.

sorted. replaced

reply = myScanner.next().charAt(0);

in place of

reply = myScanner.nextInLine(".").charAt(0);

And works thanks for your reply.

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