File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Teachers' Lounge and the fly likes Teaching Scanner Class/Formatting Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Books and Education » Teachers' Lounge
Reply Bookmark "Teaching Scanner Class/Formatting" Watch "Teaching Scanner Class/Formatting" New topic
Author

Teaching Scanner Class/Formatting

James Chegwidden
Author
Ranch Hand

Joined: Oct 06, 2002
Posts: 201
I was wondering about the Scanner class for I/O and files as well as formatting numbers.

Since it is the with the newest version of Java is Scanner now the "prefered" way of teaching I/O. I see now three ways of showing keyboard input:

1. Using Scanner class
2. Using BufferedReader
3. Using JOptionPane dialog box

Should I spend time showing them all three ways or concentrate my efforts with just Scanner. With previous versions I would show both ways.

Same question with Text Files
1. Use Scanner/FileInputStream
2. Use BufferReader/FileReader

Finally, what about formatting:
1. Use DecimalFormat
2. Use printf


Would appreciate opinions from both teacher and other professionals on the preferred way to teach these topics


Mr. C<br /> <br />Author and Instructor<br />My book:<br /><a href="http://www.aw-bc.com/catalog/academic/product/0,1144,1576761614,00.html" target="_blank" rel="nofollow">http://www.aw-bc.com/catalog/academic/product/0,1144,1576761614,00.html</a>
 
IntelliJ Java IDE
 
subject: Teaching Scanner Class/Formatting
 
Threads others viewed
Study Material for Scanner and Fromatter
Scanner class question
do you recommend C++ for an introductory programming course?
Major Difference Between SCJP 4 and 5
Khalid's Q6.23 pg 271
developer file tools