Java Basic Note 6

Source: Internet
Author: User

OOP (Object oriented Programmer)

Object-oriented programming language for object-oriented programming: java,c#,php,asp

  Purpose : To describe any object in the real world as a Java language.

  There are two important concepts in Java object-oriented programming.
1. Object. Everything is an object, a real thing created by the class.
2. Class. A description of a set of objects that have the same properties and behavior.

  How Java defines the classes and the objects of the class.
public class class Name {
attributes (variables) and behaviors (methods)
}
  To create the format of an object:
    The class name object =null;//declares the object.

Object =new class name ();//Instantiate object. Objects are not allowed to be used if they are not instantiated. Otherwise it would be wrong to run the times.

  Object calls a member of the class:
The object name. Properties;
Object name. Method (Argument)

  Reference type Memory Partitioning:

1. Stack memory: The reference address is stored

2. Heap Memory: The property value of the object being stored.

  

Java Basic Note 6

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.