2014/10/22 Java Basic knowledge record (1)

Source: Internet
Author: User

Tag:os   ar    use    JAVA   SP     2014   bs    work    ef   

Today's work does not have anything to do, opened on the table has been a long time Java crazy handouts to see a look, alas, really embarrassed to say that they are learning programming, record points, accumulate points, do not want to become a great God, hope that the work should not be illiterate.

1, Chang: String a= "Java"; Java "is placed in a constant pool. and placed in new  string ("Java") memory, so each new string () will produce an object.

2, the basic type variable is converted to the string method:int  n=1; String str=n+ "";

3:tostring () method: An instance method in object that returns the class name of the object implementation class [email  Protected] +hashcode "value. When the

4:equals and ==:== base types are compared, the values are equal and return true, when the reference object comparison must point to the same object to return true; when strings are compared using equals, the values are equal and return true;

5: Automatic unboxing Box: The basic type is directly assigned to the wrapper class object, the wrapper class object is copied directly to the basic type; Wrapper class object General method: Basic type and String type conversion: Xxx.parsexx ()--string conversion to basic type; The base type is converted to a string: string.valueof ();

The use of the

6:static, the decorated member is a class member, and the class member belongs to the class, not to an object. An object called a class member is actually a delegate class that invokes a class member. Singleton class: A class that can create only one instance, which must be implemented through a class, so the constructor must be a static adornment for the class member, create an instance in the constructor, and the next object to be created is this instance, thus enabling only one instance to be created.

2014/10/22 Java basic knowledge Record (1)

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.