Comparison operators between class objects and Instanceof

Source: Internet
Author: User

Class type conversion:

1. Upward Transformation (small

For example:

Subclass to parent class,

Features: Automatic Transformation

2. Downward Transformation (large

For example, parent rotor,

Features: Forced Transfer

Dog = dog (); lDog = dog}

Instanceof

Syntax: Object

Indicates whether an object belongs to a class.

Note: This comparison operator cannot be used at will. It must be used when there is an inheritance relationship between the class and the class.

Dog = Police dog (); (dog Wolf dog) Wolf dog lDog = police dog Wolf dog}

 

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.