Java Object Oriented thinking

Source: Internet
Author: User

Tag: member function represents abstract own age unit operation parameter input

The core idea of Java, object-oriented thinking.

The highest level of Java-oriented objects is the object of everything.

Objects: In reality, things can be called objects, objects are physical things, people, birds, tables, trees, buildings and so on. Object also has its own property behavior, and attribute behavior is divided into dynamic behavior and static behavior. The person's age name sex height and other properties are static, people can sing, swim, cry and other behaviors are dynamic.

An object is an entity used to describe an objective thing in a system, which is a basic unit of a system. It is also composed of some basic properties and some methods of manipulating these properties.

A class is a vector of object properties and behaviors (methods), and entities that have the same properties and behaviors (methods) are called classes.

The first letter of the class name is capitalized, and the method variable name is lower case.

Differences between classes and objects:

1, the class is abstract, the concept, represents a kind of things, such as human, birds and so on.

2, the object is concrete, actual, represents a specific thing.

3, the class is the object template, the object is an individual, an instance.

A member method (member function) of a class defines:

Public returns a data type method (function) name (argument list) {

statement;//method (function) body

}

Parameter list: member function input

Data type (return type): Represents the member function output

Function Body: Represents a block of code in order to implement a function

Java Object Oriented thinking

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.