课程: Java Memory Management: Values and References
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Primitives
- [Instructor] Primitives are raw values. They're nothing more than these three things in memory, a name, a type, and a value. Primitives in methods live on a stack memory, and primitives on objects live on the object on the heap memory. So there are eight primitive types. We have the int for round numbers, We have the byte for smaller round numbers. We have short for bigger than byte, but smaller than int round numbers. We have long for longer than int round numbers. And we have float for decimal numbers. We have double for bigger decimal numbers, and float, or at least for more precise decimal numbers and float. And we have Boolean for true or false. And then we have char, for characters. Or actually, positive round numbers between zero and 65,000 something, something. So these are the eight primitive types. And you have to be careful, to not confuse the primitives and wrapper classes. The wrapper classes are easily recognized, because they start with a capital, for the types. So…