Java Programming thought note (Everything is an object)

Source: Internet
Author: User

1. Manipulate the object (TV) with a reference (remote control):String s = "asdf";
2. All objects must be created by you:string s = new String ("asdf");
2 (1). Where to store:Registers (fast, cannot be controlled directly), stacks (1. If the stack pointer moves down, the new memory is allocated, and if you move up, the memory is freed.) 2.Java data is stored on the stack-especially object references-and Java objects are not stored in them. The 3.Java system must know the exact life cycle of all items stored within the stack to move the stack pointer up or down. Heap (1. You do not need to know how long the stored data will survive in the heap, but simply write a simple line of code 2 with new when you need the object. Storage allocation and cleanup with stacks can take more time than storage allocation with stacks), constant storage, non-RAM storage,
2 (2) Exception: Basic type:Boolean, char (bits), byte (8 bits), short (BITS), int (bits), long (bits), float (bits), double (bits), void
2 (3) Arrays in Java
3. Never need to destroy objects
3 (1). Scope:The scope is determined by the position of the curly brace, and the variable defined in the scope is only available until the scope ends
3 (2). Scope of the object:When you create a Java object with new, it can survive outside the scope.
4. Create a new data type: Class
4 (1). Fields (data members) and methods (member functions)
5. Methods, parameters, and return values:Method: Name, parameter, return value and method body; int x = A.F ();//message is F (), object is a
5 (1). parameter list:Type and name
6. Build a Java program:Name Visibility (package), use other artifacts (import), static keyword (1. You can call its static method or access its static domain 2 even if you have never created any objects of a class. Only one copy of storage space)
7. Your first Java program:Compiling and running
8. Annotations and embedded Documents
8 (1). Note Document
8 (2). Syntax:Javadoc (/** */)
8 (3). Embedded HTML: (/** */) do not use the title tag in embedded HTML, Javadoc will insert its own title, and your title may conflict with them.
8 (4). Some examples of tags
8 (5). Documentation Examples
9. Coding style

Java Programming thought note (Everything is an object)

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.