Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes what is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is "scnaf" on java??" Watch "what is "scnaf" on java??" New topic
Author

what is "scnaf" on java??

guy dv
Greenhorn

Joined: Jan 15, 2001
Posts: 1
can some one tell me what is the syntx of scanf?
i use jdk1.2 in dos format and i need to know what is scanf
syntx in java.

------------------
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
Guy,
There is no scanf in JAVA. scanf is a C library function. If you're looking for equivalant functionality, then I would recommend looking at the JAVA I/O classes.
-Peter
Brett Knapik
Ranch Hand

Joined: Oct 15, 2000
Posts: 255
That was the nice thing about c/c++ having easy ways to get i/o unlike java.
------------------
I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Java does provide plenty of tools to parse input streams, and none of them are as bug-inducing as scanf. On most C and C++ projects I've worked on we've had a "no scanf" rule, as it is just so hard to get right and so easy to crash the system with accidentally wrong input data.
Is there some sort of input parsing you actually need to do? I'm sure there are plenty of people here who could help.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
henrik
Greenhorn

Joined: Oct 30, 2001
Posts: 1
I have a free and fully functional Java printf/scanf at:
http://www.braju.com/beta/
It is a beta since it requires more testing before I can upgrade it to a full version. However, no bugs have been found. The very stable Java printf only package is at http://www.braju.com/ and that has been up and running since 1997.
Cheers,
Henrik Bengtsson
M.Sc. Computer Science
Ph.D. student in Statistics
Lund University, Sweden
h e n r i k b @ b r a j u . c o m
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
henrik
Thanks for your input, hopefully some of our visitors can make use of your product. However, your name is not in keeping with the naming policy here at the ranch. Please re-register under an appropriate name as shown in the policy.
Thanks again and we hope to see you around the ranch!!

------------------
Dave
Sun Certified Programmer for the Java� 2 Platform


Dave
Henrik Bengtsson
Greenhorn

Joined: Oct 30, 2001
Posts: 2
Sorry about that!
"henrik"

Henrik Bengtsson<P>M.Sc. Computer Science<BR>Ph.D. student in Statistics<BR>Lund University, Sweden<BR>h e n r i k b @ b r a j u . c o m
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Thanks Henrik
Hope you enjoy your time here at the ranch!!

------------------
Dave
Sun Certified Programmer for the Java� 2 Platform
Dustin Sallings
Greenhorn

Joined: Sep 17, 2003
Posts: 1
This is a very old thread, but it comes up pretty early for anyone looking for scanf type functionality for java. I think MessageFormat is an appropriate way to handle this type of thing The Java Way(tm) (seen here in jython):
>>> import java
>>> mf=java.text.MessageFormat("{0} days {1}:{2}:{3}")
>>> os=mf.parse("1 days 4:20:02")
>>> os
array(['1', '4', '20', '02'], java.lang.Object)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: what is "scnaf" on java??
 
Similar Threads
what sort of indenting you prefer?
user input
user input
what is """scanf"""" in java??????
Input statements in Java?