Java basic data types and reference types

Source: Internet
Author: User

These basic data types are not something to come up with.

3 Types of references

Classes Class

Interface interface

Arrays Array

First one: Class

Integer Long Boolean Byte Character Double Float Short These classes

Automatically boxed into an object

The String:string class represents a string, and all string literals (such as "ABC") in a Java program are implemented as instances of this class

String str = "LCY"//STR is a variable of reference type (object can point out method) (object's manager)

Date:date represents a specific moment, accurate to

Second one: interface

List List = new ArrayList (), List of variables for this interface type , Object Manager, owning method

list<e>: list, the user of this interface can precisely control the insertion position of each element in the list. The user can index an integer based on the element

The position in the list) accesses the element and searches for the element in the list.
Add (): Inserts the specified element in the list.
Remove (): Removes the element from the specified position in the list.
Get (int index): Returns the element at the specified position in the list.

Map<k,v>:

Java basic data types and reference types

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.