Data type of Java

Source: Internet
Author: User

Classes and objects
    1. Declaring an Object
    =null;    // 开辟一个堆内存的空间    =newPerson()        // 注意 所有的对象(所有的引用数据类型)必须在其开辟堆内存空间,才能被使用,    // 只声明,未开辟堆内存空间, 编译器编译的时候不会报错, 但是执行代码的时候, 会报nopoint的错误,即指针错误
    1. Analysis of reference passing
    引用传递的本质就在于别名:这个别名放在栈内存中    // 所有的编程语言 引用数据类型相似

Reference data type model

    1. Private implementation of encapsulation of data
    对数据的封装 解决了那些问题了    1. 数据的合理性, 例如年龄不可为负数, 商品的总价个不可能为负数    虽然也有方法的私有,但是比较少这里不做考虑
    1. Overloading of methods

Data type of Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.