Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
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
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
Programmer Certification (OCPJP)
Scanner class
sumedha rao
Ranch Hand
Posts: 115
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The following program is from k and b, pg501 chpt 6....error on line token= s.findLine(args[0]);....why???
import java.util.Scanner; class ScanIn { public static void main(String args[]) { System.out.println("input: "); System.out.flush(); try { Scanner s=new Scanner(System.in); String token; do { token=s.findLine(args[0]); System.out.println("found "+token); }while(token!=null); } catch(Exception e) { System.out.println("scan exc"); } } }
scjp1.6,scwcd1.5:)!!!
Swastik Dey
Bartender
Posts: 2270
20
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The method is findInLine(), not findLine()
You may go through the api
doc
http://download.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html
Swastik
sumedha rao
Ranch Hand
Posts: 115
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
argghh
.............i think i need a break from java...acting so stupid these days
scjp1.6,scwcd1.5:)!!!
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Scanner...K&B p.no:484
K & B example Problem.
using Scanner class in search
Tokenizing
How to add elements from a file into an Array List
More...