Chapter2_4-InputOutput

Outprintln the end page 3 dr s gannouni dr a touir

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: em.out.println( y ); System.out.println( " THE END“ ); Page 3 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP Standard Input • To input primitive data values, we use the Scanner class. • 4 steps are needed to be able to use input primitive: – Step 1: import the Scanner class: • import Java.util.Scanner; – Step 2 : declaring a reference variable of a Scanner • Scanner read ; //we named the object read – Step 3: creating an instance of the Scanner • read = new Scanner (System.in); – Step 4: use specific methods to enter d...
View Full Document

Ask a homework question - tutors are online