Arrays - Stanford University
Arrays
Chris Piech
CS106A, Stanford University
Changing Variable Types
int to double?
int to String?
int x = 5;
double xDbl = x;
int x = 5;
String xStr = ¡°¡± + x
String to int?
String to double?
String xStr = ¡°5¡±;
int x = Integer.parseInt(x);
String xStr = ¡°5.6¡±;
double x = Double.parseDouble(xStr);
Casting double to int
double x = 5.2;
int y = (int)x;
GObject to GRect
GObject obj = getElementAt(5, 2);
GRect objRect = (GRect)obj;
int to char
int diff = ¡®C'-¡¯A¡¯;
char next = (char)¡®a¡¯ + diff;
Where are we?
?
?
?
?
?
?
?
?
Karel the Robot
Java
Console Programs
Graphics Programs
Text Processing
Data Structures
Defining our own Variable Types
GUIs
Winter is Coming!
Thanks Keith Schwarz for some great slides to build off!
Karel Wars
Thanks to Nick Troccoli for the awesome example
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- cs106a stanford handout 49 fall 2004 05 nick parlante
- chapter 19 java data structures
- ch7 list and iterator adts
- arrays and arraylists
- big o arraylist carnegie mellon university
- arrays stanford university
- arraylist reading 10
- arraylist in java
- java arraylist copyright © tutorialspoint
- building java programs chapter 10
Related searches
- stanford university philosophy department
- stanford university plato
- stanford university encyclopedia of philosophy
- stanford university philosophy encyclopedia
- stanford university philosophy
- stanford university ein number
- stanford university master computer science
- stanford university graduate programs
- stanford university computer science ms
- stanford university phd programs
- stanford university phd in education
- stanford university online doctoral programs