Java Private Learning Notes--4th class and Object basics

Source: Internet
Author: User

4.1 Object-oriented basic 4.1.2 Object-oriented features 1. Encapsulation 2. Inheritance 3. Polymorphism 4.2 The definition of class for Java class and object 4.2.1 class includes the definition of class declaration and class body; 1. class declaration [PU               blic][abstract | final]class classname[extends superclass][implements interfacenamelist]{//Member variable declaration Member method declaration} Abstract class cannot be instantiated, final end class cannot be inherited; 4.2.2 object using Reference Object name _ object name 4.2.3 UML diagram representation class
Class name
List of member variables
Method List


4.2.4 Understanding stacks and heaps

When the Java program runs, the JVM needs to allocate memory to the data. The memory space is logically divided into two structures: stack and heap. When the Java program runs, the called method parameters and local variables defined in the method are stored in the memory stack, and when the program runs new to create the object, the JVM allocates memory in the heap.

Java Private Learning Notes--4th class and Object basics

Related Article

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.