tailieunhanh - Lecture Fundamentals of computing 1: Lecture 2 - Duy Tan University

Lecture Fundamentals of computing 1: Lecture 2 introduce data type, variables, expressions, operators. The main contents of this chapter include all of the following: Data types, expressions, operators, variables, constants. Inviting you refer for more infomation. | Lecture Title: Data type, Variables, Expressions, Operators Fundamentals of Computing 1 Agenda Data types Expressions Operators Variables Constants ask them, how might the computer store "hi" using binary digits? (some kind of mapping; ASCII) Data types type: A category or set of data values. Has a specific range of values Constrains the operations and methods that can be performed on data Examples: integer number, real number, string ask them, how might the computer store "hi" using binary digits? (some kind of mapping; ASCII) Primitive types Java supports 8 primitive types: byte, short, int, long, float, double, char and boolean. They are called primitive types because they are not classes Java also has class types (object types), which we'll talk about later We're basically going to manipulate letters and numbers. We make the integer / real number distinction in English as well. We don't ask, "How many do you weigh?" or, "How much sisters do you have?" Part of the int/double split is related to how a computer processor crunches numbers. A CPU does integer computations and a Floating Point Unit (FPU) does real number computations. Why does Java separate int and double? Why not use one combined type called number? Numeric Data Types Name Range Storage Size byte -27 (-128) to 27 - 1(127) 8-bit signed short -215 (-32768) to 215 - 1(32767) 16-bit signed int -231 (-2147483648) to 231 - 1(2147483647) 32-bit signed long -263 to 263 - 1 64-bit signed float Negative range: + 38 to Positive range: to + 38 32-bit IEEE 754 double Negative range: to Positive range: to 64-bit IEEE 754 Number primitive types The boolean type Can only store 2 values, which are expressed using the Java reserved words true and false Is typically used decision making or for controlling the order of execution of a program boolean isEmpty; boolean passed, failed; The boolean | Lecture Title: Data type, Variables, Expressions, Operators Fundamentals of Computing 1 Agenda Data types Expressions Operators Variables Constants ask them, how might the computer store "hi" using binary digits? (some kind of mapping; ASCII) Data types type: A category or set of data values. Has a specific range of values Constrains the operations and methods that can be performed on data Examples: integer number, real number, string ask them, how might the computer store "hi" using binary digits? (some kind of mapping; ASCII) Primitive types Java supports 8 primitive types: byte, short, int, long, float, double, char and boolean. They are called primitive types because they are not classes Java also has class types (object types), which we'll talk about later We're basically going to manipulate letters and numbers. We make the integer / real number distinction in English as well. We don't ask, "How many do you weigh?" or, "How much sisters do you have?" Part of .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.