201671010128 2017-10-30 "Java program Design" of the generic programming

Source: Internet
Author: User
Tags class definition

First, the basic concept

    1. Generics are also known as parameterized types (parameterized type), that is, when defining classes, interfaces, and methods, the type parameter indicates the type of object that will be processed. (e.g. ArrayList Class)
    2. Generic Programming (Generic programming) means that writing code can be reused by many different types of objects.
    3. A generic class (generic Class) is a class that has one or more type variables, that is, a class that is created with a type as a parameter.

Second, some characteristics

    1. A generic class can have more than one type variable. For example: public class pair<t, u> {...}
    2. A type variable in a class definition is used to specify the return type of the method and the type of the domain, local variable.

Iii. generic methods

    1. In addition to generic classes, you can define only one method as a generic method, specifying either a method parameter or a return value of a generic type, to be determined when the method is called.
    2. A generic method can be declared in a generic class or declared in a normal class.

Four, object-oriented programming curriculum learning progress bar

Moonphases Number of lines of code (read/write) Post Blog volume/Comment blog number Classroom/after-school time (hours) The most satisfying programming task
First week 20/7 1/1 6/4 Write the Hello World program
Second week 38/20 1/1 6/5 Experiment two task three
Third week 50/30 1/1 6/7 Experiment Three
Week Four 58/46 1/1 6/5 Write the output n digits of the numbers, and sum
Week Five 67/53 1/1 6/6 Classes are defined and overloaded
Week Six 71/60 1/1 6/4 Interface
Eighth Week 80/66 1/1 6/3 LAMDBA-expression
Nineth Week 85/60 1/1 6/2 Operation of the ID
Tenth Week 121/80 1/ 6/2 Experiment Nine
......
Cumulative 590/415 9/8 54/38

201671010128 2017-10-30 "Java program Design" of the generic programming

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.