Java Chapter Fifth: Object-oriented (OOP)

Source: Internet
Author: User

Object : An instance that has features and functionality.

Class : Is an abstraction of an object, a concept in people's mind, a collection of objects with common characteristics or the same behavior, and the use of classes to create objects;

Create class: [Modifier] class class name { Create object: Class Name Object name = new class name ();

Properties: Similar to variable naming, [modifier] Data Type property name analogy: Scanner input = new Scanner (system.in);

Method: [modifier] Returns a value type method name (parameter list) { Access property and assign value: Object name. property name = value;

method body; access method (non-static): Object name. Method name ();

Access static method: Class name/Object name. Method name ();

}

Java Chapter Fifth: Object-oriented (OOP)

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.