Differences between objects, classes, and objects and classes in Java

Source: Internet
Author: User

The following is my personal understanding, and I want to hear others' opinions.

In my opinion, objects, classes, and JavaProgramThere are some differences between classes and objects in the design.

Object-oriented:
Class-in the concept, 'class' is a collection of similar things. In order to distinguish different clusters, such classes can be used as a template, in addition, you can add, modify, and reduce attributes to become different objects.
Object-the 'object' In the concept is a special case of 'class'. It corresponds to a specific thing. When a specific description of a 'class' is made, an object is formed.

These are all abstract concepts, and classes and objects in Java programming are much more specific.

Java programming:
Class -- inCodeWhen the 'class' keyword is used to declare a class, the class can be an abstract class and can be inherited, subclass can be changed or expanded to the attributes of the parent class to create a new class. Even in a specific class, it is only a class and will not become an object, in addition, subclass attributes can only be greater than or equal to the attributes of the parent class and cannot be reduced.
Objects in Java refer to objects in program calls. In order to be able to operate on a computer, some specific methods are required to instantiate a specific class and allocate memory space, this is the object of a specific class.

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.