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
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 { ...
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ìm kiếm theo từ khóa liên quan:
Cấu trúc dữ liệu Bài giảng cấu trúc dữ liệu Cấu trúc dữ liệu Chương 1 Basic language elements Cấu trúc dữ liệu mảng Các giải thuậtGợi ý tài liệu liên quan:
-
Đề cương chi tiết học phần Cấu trúc dữ liệu và giải thuật (Data structures and algorithms)
10 trang 318 0 0 -
Giải thuật và cấu trúc dữ liệu
305 trang 162 0 0 -
Bài giảng Phân tích thiết kế phần mềm: Chương 1 - Trường ĐH Ngoại ngữ - Tin học TP.HCM
64 trang 150 0 0 -
Tập bài giảng Thực hành kỹ thuật lập trình
303 trang 143 0 0 -
Giáo trình Cấu trúc dữ liệu và thuật toán (Tái bản): Phần 1
152 trang 139 0 0 -
Tài liệu tham khảo: Cấu trúc dữ liệu và giải thuật
229 trang 124 0 0 -
Bài giảng Cấu trúc dữ liệu và thuật toán: Chương 3 - Một số mô hình thuật toán
42 trang 74 0 0 -
Lập trình C - Cấu trúc dữ Liệu
307 trang 74 0 0 -
Ứng dụng và cài đặt cấu trúc dữ liệu bằng C: Phần 1
338 trang 73 0 0 -
49 trang 71 0 0