-java-generics

Source: Internet
Author: User

Statement: The material used in this column is written by the VIP students of the Kay Academy, who has the right to be anonymous and has the final right to interpret the article; The Edith Academy is designed to promote students to learn from each other on the basis of public notes.

Vector:

1. Slow speed in multi-threaded situations

2. Thread-Safe classes

2 is the oldest collection class.

LinkedList:

This class is like a double-stranded set.

AddFirst is added to the front

AddLast is added to the back

Removelast is to be removed from the back

Removefirst is to remove from the front

Stack Stacks collection:

This collection inherits from the vector is also thread-safe

Push Stack is an added

Pop out of the stack

Peek feedback current object to be out of stack

1. First take out the current object to be out of the stack

2. Press the subscript to output the object to be out of the stack

3. Return the object taken out

Generic type:

What is a generic type? The purpose of generics is to describe the types stored in the collection

A class has requested generics, and if you don't use it, it's an object type.

This class has applications for generics you can write generics, no need to write

It's like this, which gives you the ability to save a string type.

You don't have to be the object type, if you define the string type that is the string type

A class can request a number of generics, such as:

Customize the generic type in the parameter type

-java-generics

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.