PLEASE SUBSCRIBE!!!
In the previous lesson ( • Java Programming: Lesson 61 - More Te... ), we took a look at longs, ints, shorts, floats, and doubles. We review these primitives in this video and also briefly discuss the wrapper classes. We will also talk about enumerations in this video, which are similar to iterators but do not offer a remove( ) method and have longer method names.
int: a primitive integer, can hold 32 bits
double: a primitive decimal number, can hold 64 bits
long: a primitive integer, can hold 64 bits
short: a primitive integer, can hold 16 bits
float: a primitive decimal number, can hold 32 bits
Integer: a wrapper class for int, contains import properties and methods for ints
Double: a wrapper class for double, contains import properties and methods for doubles
Long: a wrapper class for long, contains import properties and methods for longs
Short: a wrapper class for short, contains import properties and methods for shorts
Float: a wrapper class for float, contains import properties and methods for floats
y instanceof C returns true if and only if y was instantiated as C or any subclass of C (or sub-sub class, sub-sub-sub, ...)
An enumeration is like an iterator, but with longer method names and no remove method. You can call an enumeration on a Vector or Stack, but not on other data structures. You're better off importing Iterator and creating an Iterator object on a particular data structure. But for enumerations:
1. import java.util.Enumeration;
2. create an Enumeration object on your data structure
3. while( enumeration.hasMoreElements( ) )
4. System.out.println( enumeration.nextElement( ) )
0:03 Review of Long, Short, and Float Classes
8:29 Review of Vectors and instanceof
13:46 NEW: Enumerations
Ok, well enumerations are worse than iterators. Is there anything better than iterators?? Maybe... • Java Programming: Lesson 63 - List It...
Thanks for watching, and PLEASE SUBSCRIBE!!!