51

Java中的基本数据类型及其封装类-12212886-51CTO博客

 6 years ago
source link: http://blog.51cto.com/12222886/2067549
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
    Java中的数据类型有两种,基本数据类型和引用数据类型,引用数据类型的创建是需要去new一个对象,该对象的内存分配在堆区,同时栈区会保存一个指向该对象的引用,但是对于一些简单数据的创建,用new的方式就不是很有效了,因此JVM中定义了一套对于基本数据类型的描述,它直接保存值到堆栈当中,而不需要在堆中创建对象。   &nb

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK