lecture9 - PIC 20A Lecture 9: Dialogs, Wrapper Classes,...

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

View Full Document Right Arrow Icon
PIC 20A Lecture 9: Dialogs, Wrapper Classes, AutoBoxing, Enhanced for loop, Packages
Background image of page 1

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

View Full DocumentRight Arrow Icon
Input Dialog Boxes Getting input from the keyboard using an input dialog String input = JOptionPane. showInputDialog ("Enter some integers: "); /* Stores the user's data into String input */
Background image of page 2
Message Dialog Boxes Sending a message to the user using a message dialog. JOptionPane. showMessageDialog ( null , "Thanks for programming");
Background image of page 3

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

View Full DocumentRight Arrow Icon
Wrapper classes • classes which allow you to treat primitive data type values as objects • a wrapper class exists for each primitive data type • wrapper class objects contain a corresponding primitive data type value as an instance field
Background image of page 4
Wrapper classes • Boolean • Integer • Character • Float • Byte • Double • Long • Short
Background image of page 5

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

View Full DocumentRight Arrow Icon
What is Auto-boxing? Auto-boxing • is the automatic conversion between primitive data type values and wrapper class objects which hold or “ wrap ” those values • was introduced by Java version 1.5.0 (does not work for earlier versions)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 20

lecture9 - PIC 20A Lecture 9: Dialogs, Wrapper Classes,...

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

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