parsingworksheet - Name : _ Date : _ Parsing Worksheet 1

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

View Full Document Right Arrow Icon
Name : ___________________________ Date : _________________ Parsing Worksheet 1 DIRECTIONS :   Fill in each blank with the correct answer/output.  Assume each statement  happens in order and that one statement may affect the next statement. char cvar = ‘H’; //16 bit unsigned integer data type byte bvar = 255; //8 bit integer data type short notbig = 32767; //16 bit integer data type int ivar = 327670; //32 bit integer data type long lvar = 7; //64 bit integer data type float fvar = 32.22f; //32 bit real number data type double dvar = 123.456; //64 bit real number data type 1. int x = Integer.parseInt("45"); out.println(x); ______________ | error 2. byte b = Byte.parseByte("99"); out.println(b); ______________ | error 3. b = Integer.parseInt("45"); out.println(b); ______________ | error 4. b = (byte)x; out.println(b); ______________ | error 5. double d = Double.parseDouble("999.999"); out.println(d);_____________ | error 6. d = Double.parseDouble("3.2e2"); out.println(d);
Background image of page 1

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

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

This note was uploaded on 01/24/2011 for the course COMP SCI 543 taught by Professor Mark during the Spring '10 term at Brown College.

Page1 / 2

parsingworksheet - Name : _ Date : _ Parsing Worksheet 1

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

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