Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: i need help figuring out what is wrong in my code Date: Mon, 12 Dec 2016 18:08:47 -0500 Organization: A noiseless patient Spider Lines: 23 Message-ID: References: <6f8c0f7d-a8b2-4e50-b815-d5d77e6e25d5@googlegroups.com> <9c73d4a8-b20f-42c0-bb87-dd1c1966fdbd@googlegroups.com> <64fe5d3e-7f71-4d26-ad6e-c47136806f08@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 12 Dec 2016 23:07:25 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="a700588d24308dff6cdbdc832c4ad3b2"; logging-data="11222"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18H1T+L/bysVvgCsNQn97bN" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 In-Reply-To: Cancel-Lock: sha1:bNgM6oL1Y/02mSyEqf6/sc+wUWw= Xref: csiph.com comp.lang.java.programmer:36105 On 12/12/2016 5:17 PM, Karim omar wrote: > On Tuesday, December 13, 2016 at 12:28:49 AM UTC+3, Eric Sosman wrote: >> [...] >> Let's see: Does Scanner have a method that moves to the next line? >> We peruse the Javadoc for a while and we find a method that >> >> "Advances this scanner past the current line and returns the >> input that was skipped. [...] The position is set to the >> beginning of the next line." >> >> ... and Lo! it turns out to be a method you're already familiar with! >> Perhaps if you used that method before findInLine(), things might go >> more smoothly. Care to try it? > > damn!! , it`s (Scanner myNewScanner = new Scanner(System.in);) that solves it to reset the Scanner , couldn`t sleep before figuring it out , it appers that i am a little bit slow learner :) That's like "My car is out of gas; time to get a new one." Keep looking. -- esosman@comcast-dot-net.invalid "Nobody ever went broke underestimating the intelligence of the American public." -- HLM (paraphrased)