Danh mục

Bài giảng Cấu trúc dữ liệu: Chương 1 - Nguyễn Xuân Vinh

Số trang: 23      Loại file: pptx      Dung lượng: 400.81 KB      Lượt xem: 14      Lượt tải: 0    
Thư viện của tui

Phí tải xuống: 12,000 VND Tải xuống file đầy đủ (23 trang) 0
Xem trước 3 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Bài giảng Cấu trúc dữ liệu - Chương 1: Java basic trình bày về basic language elements, data types, literal, variables, constant, JVM memory, why string is immutable. Đây là tài liệu tham khảo dùng cho sinh viên chuyên ngành Công nghệ thông tin.
Nội dung trích xuất từ tài liệu:
Bài giảng Cấu trúc dữ liệu: Chương 1 - Nguyễn Xuân VinhGV: NGUYỄN XUÂN VINH CẤU TRÚC DỮ LIỆU DATA STRUCTURES [214441] JAVA BASICMÔN: CẤU TRÚC DỮ LIỆU Nguyễn Xuân Vinh6/12/14 nguyenxuanvinh@hcmuaf.edu. vn/XX1GV: NGUYỄN XUÂN VINH 1. Basic Language Elements • Identifiers – A name in a program is called an identifier – An identifier in java is composed of a sequence of characters (include: letter, digits or connecting symbols ($, _). The first character in an identifier can’t be a digit.MÔN: CẤU TRÚC DỮ LIỆU – – Identifiers in java are case sensitive. • Keywords – Key words are reserved identifiers. – In java, all keywords are in lower case. • Literals A literal denotes a constant value of a particular data type6/12/14 – – The value a literal represents remains unchanged in the program./XX23 /XX 6/12/14 MÔN: CẤU TRÚC DỮ LIỆU GV: NGUYỄN XUÂN VINH 2. Data TypesGV: NGUYỄN XUÂN VINH 2.1 Primitive Data Types Types Length Values Default value byte 8-bit -28  28 – 1 0 short 16-bit -216  216 – 1 0 int 32-bit -231  231 – 1 0 long 64-bit -263  263 – 1 0MÔN: CẤU TRÚC DỮ LIỆU float 32-bit IEEE 754 floating +/-3.40282347E+38  +/- 0.0f point 1.40239846E-45 double 64-bit IEEE 754 floating +/-1.79769313486231570E 0.0d point  +/-4.9065645841246544E- 324 boolean 1-bit true, false false char 16-bit Unicode u0000 (0)  uffff (65.535)6/12/14/XX45 /XX 6/12/14 MÔN: CẤU TRÚC DỮ LIỆU GV: NGUYỄN XUÂN VINH 2.1 Primitive Data TypesGV: NGUYỄN XUÂN VINH 2.2 Reference Data Types • Reference to Tham chiếu tới một giá trị hay là tập hợp các giá trị mà biến khai báo.MÔN: CẤU TRÚC DỮ LIỆU • Các kiểu dữ liệu dẫn xuất:6/12/14/XX6GV: NGUYỄN XUÂN VINH 3. Literal • The new keyword isnt used when initializing a variable of a primitive type. • A literal is the source code representation of a fixed value. • Literals are represented directly in your code without requiring computationMÔN: CẤU TRÚC DỮ LIỆU boolean result = true; char capitalC = C; byte b = 100; short s = 10000; int i = 100000;6/12/14/XX7GV: NGUYỄN XUÂN VINH 4. Variables • Parameters » The variables that are listed as part of a method declaration. Each parameter must have a unique name and a defined data type. public void method(int a, double b, boolean c)MÔN: CẤU TRÚC DỮ LIỆU { ...

Tài liệu được xem nhiều: