05-scanner-input

05-scanner-input - Java Console Input CSE 114 Computer...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Java Console Input CSE 114: Computer Science I 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Announcements Course Scheduling Labs begin Thursday, September 25 Labs will be held in the Life Science and CS SINC sites Recitation ofFce hours begin ±riday, 9/26, in CS 2110 Upcoming Assignments: HW GOAL-1 will (Fnally!) be posted tonight It will be due by 11:59 PM on Sunday, 9/28 2
Background image of page 2
Streams Java input and output are treated as streams of characters (actually, bytes) A stream is a sequence of data that Fows in one direction e.g., keyboard to program, program to display Data is processed in ±rst-in, ±rst-out order 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
User input (hitting Enter after each line): 23 some words 114.03 more text to process Stream Illustration 2 3 \n s o m e w o r d s \n 1 1 4 . 0 3 m o r e \n t e x t \n t o \n p r o v e s s \n 4
Background image of page 4
Basic Input In Java 1.5 or later, use the Scanner class to read from the keyboard (or other sources) Scanner’s methods return the next value of a given type nextLine(), nextInt(), nextDouble(), etc. These methods only work if the remaining input begins
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/03/2009 for the course CSE 114 taught by Professor Tashbook during the Spring '08 term at SUNY Stony Brook.

Page1 / 8

05-scanner-input - Java Console Input CSE 114 Computer...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online