Chapter2_4-InputOutput

Outprintlnthe area is area page 5 dr s gannouni dr

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: + lenght); 9 System.out.println(“the width is ”+ width); 10 System.out.println(“the area is ”+ area); Page 5 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP Common Scanner Methods • Method Example Scanner input = new Scanner (System.in); nextByte( ) nextDouble( ) nextFloat( ) nextInt( ) nextLong( ) nextShort( ) next() Page 6 byte b = input.nextByte( ); double d = input.nextDouble( ); float f = input.nextFloat( ); int i = input.nextInt( ); long l = input.nextLong( ); short s = input.nextShort( ); String str = input.next(); Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP...
View Full Document

This document was uploaded on 03/03/2014.

Ask a homework question - tutors are online