`
- 浏览:
23938 次
- 性别:
- 来自:
深圳
-
Java Notes: Data types and Operators
Comprehend
- A variable holds a value, while an object reference variable points to the memory that holds the object.
- The short-circuit logical operators && and || operate only on boolean operands. For example, the expression
9&&7 will not compile. Understand the difference between short-circuit logical operators and bitwise
operators.
- If the first expression of a && operator is false, the second expression is not evaluated, and if the first
expression of a || operator is true, the second expression is not evaluated.
Look Out
- Be on guard for words that are only slightly different from the
Java keywords, such as synchronize instead of synchronized, implement
instead of implements, and protect instead of protected.
- Whether an array stores primitive variables or object references, the array itself is always an object.
- It is illegal to include the array size in the array declaration.
- Division by zero generates a runtime ArithmeticException only if
the operands are integers. In case of float and double, the result of
division by zero is infinity.
- The result of the modulo operator always carries the sign of the first operand (i.e. the one before the operator);
you can ignore the sign of the second operand.
- You cannot instantiate an enum by using the new operator.
Memorize
- Know the Java language keywords.
- Know the range of values for all primitive data types.
- All primitive data types except boolean and char are signed.
- The first character of an identifier must be a letter, a dollar
sign ($), or an underscore (_). Characters other than the first
character in an identifier may be a letter, a dollar sign, an
underscore, or a digit.
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
Chapter 11 Abstract Data Types and Encapsulation Constructs 459 11.1 The Concept of Abstraction 460 11.2 Introduction to Data Abstraction 461 11.3 Design Issues for Abstract Data Types 463 ...
**Data Types and Variables** Python supports several built-in data types, including numbers, strings, lists, tuples, dictionaries, and booleans. - **Variables:** Variables are used to store values. ...
ABL provides built-in data types, built-in class data types, and user-defined class data types. References to built-in data types follow these rules: * Like most other keywords, references to specific...
2.6 Tree data and relations 2.7 Prolog lists and sequences 2.8 Change for a dollar 2.9 Map coloring redux 2.10 Simple I/O 2.11 Chess queens challenge puzzle 2.12 Finding all answers 2.13 Truth ...
Operators And Special Methods Builtins Build and C API Changes Performance Porting To Python 3.0 What’s New in Python 2.7 The Future for Python 2.x Changes to the Handling of Deprecation ...
Database Applications and Control Data Notes About Performance Tuning Tuning Your Database Machine Tuning Your Database About ODBC and Unicode Comparing DAO and ODBC Database Support Efficiency...
Length Arrays and alloca() Friends Exceptions Run-Time Type Information (RTTI) Casting Streams Preincrement and Predecrement Use of const Integer Types 64-bit Portability Preprocessor Macros 0 and ...
QWORD, and TBYTE Variables 5.3.5 - Declaring Floating Point Variables with REAL4, REAL8, and REAL10 5.4 - Creating Your Own Type Names with TYPEDEF 5.5 - Pointer Data Types 5.6 - ...
7.5.6. Route Types 7.5.6.1. Zend_Controller_Router_Route 7.5.6.1.1. 变量缺省 7.5.6.1.2. 变量请求 7.5.6.2. Zend_Controller_Router_Route_Static 7.5.6.3. Zend_Controller_Router_Route_Regex 7.5.7. ...
3.3. Java 8 (as well as 6 and 7) ............................................................................... 17 3.4. Java EE 6 and 7 ..................................................................
3.3. Java 8 (as well as 6 and 7) ............................................................................... 17 3.4. Java EE 6 and 7 ..................................................................