It 18 Palm Palm Day Course Summary

Source: Internet
Author: User

Today, finish the IT 18 Day Java Foundation Course:


Learning content:

Basic type

---------------

Packing class

int Integer

BYTE byte

Short Short

Long Long

float float

Double Double

Boolean Boolean

Char Character//character class

New features that occur after JDK 1.5,

Auto-Boxing: Integer i = 12; = = = Integer i = new Integer (12);

Automatic unpacking: Integer i = 12; i + +//=== i.parseint () = 12; ++

Note: When an integer i = null, an nullpointerexception exception is reported if an automatic unboxing operation occurs.

Wrapper class and basic type Difference

----------------------

1. The wrapper class is an object, and the default value is null.

2. The basic data type of the digital type is 0.

3. The basic data type can be directly involved in the operation.

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

Collection:

---------------------------------------------------

A container for storing objects,

|-------Collection Collection Interface

|----List ordered, can be repeated, indexed

|---Vector thread-safe, with an array at the bottom, and a default allocation of twice times

|---ArrayList non-thread-safe, using the same vector, query fast, and delete more slowly. Allocate 1.5 times times the default space

|---linkedlist non-thread safe, query slow, and delete quickly

|----Set

|---HashSet is non-thread-safe, with HashMap on the bottom. these elements are correctly distributed in buckets through a hash function, allowing null to be used

|---TreeSet non-thread-safe, with a two-fork tree at the bottom

|-------Map

|--hashtable thread Safety, <k, v>

|--hashmap non-thread-safe, <k, v>, gets the set of key through Keyset (), uses get (key) call, can also get the EntrySet class object of the mapping relationship through entry (), using Getkey (), GetValue called.

|--treemap

List: Lists, Interface ArrayList ()

[] Array

---------------------

Length/Width Property

String

---------------------

Length ()//method.

equals//Overrides the Equals method in the object class, and Equals returns True if the contents of the two String class object are the same.

The Equasl method in the original object class returns true only if two objects are the same object.

Interface Collection

------------------------

Size ()//method

IsEmpty ()//==null?

Judging set validity

Col! = null && col.isempty ()

Contains (object obj)//Determines whether the specified object is included

List//Ordered, repeatable

Set//unordered, non-repeating

Map//key-value

instanceof

-----------------

operator to determine whether the variable is an object of the specified type.

Boolean b = obj instanceof String;

This.getclass () = = Student.class

/**

* Create collection, store String[tom,tomas,tomslee]

* Storage integer[100,200,300]

* Storage student{name,sex,age, Standard Javabean}[tom,tomas,tomslee]

*

*/

Arraylist//Array list, packed in pairs, accessed by subscript value.

LinkedList//Chain list,



Problems encountered:

1. An error occurred when writing the basic data type auto-boxing unpacking in Legacy Eclipse. The reason is that the eclipse version is too low and the JDK version is too low. After downloading the latest eclipse, the problem is resolved.

2. The inside of the collection is cumbersome and easy to confuse



Questions that need help


Clarify the relationship of a set

This article from "Rookie Achievement Data Road" blog, reproduced please contact the author!

It 18 Palm Palm Day Course Summary

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.