tailieunhanh - Chapter 2: Data and Expressions

Data-binding expressions are contained within delimiters and use the Eval and Bind functions. The Eval function is used to define one-way (read-only) binding. The Bind function is used for two-way (updatable) binding. In addition to calling Eval and Bind methods to perform data binding in a data-binding expression, you can call any publicly scoped code within the delimiters to execute that code and return a value during page processing. | Chapter 2 Data and Expressions © 2004 Pearson Addison-Wesley. All rights reserved 2- Data and Expressions Let's explore some other fundamental programming concepts Chapter 2 focuses on: character strings primitive data the declaration and use of variables expressions and operator precedence data conversions accepting input from the user Java applets introduction to graphics © 2004 Pearson Addison-Wesley. All rights reserved 2- Outline Character Strings Variables and Assignment Primitive Data Types Expressions Data Conversion Interactive Programs Graphics Applets Drawing Shapes © 2004 Pearson Addison-Wesley. All rights reserved 2- Character Strings A string of characters can be represented as a string literal by putting double quotes around the text: Examples: "This is a string literal." "123 Main Street" "X" Every character string is an object in Java, defined by the String class Every string literal represents a String object © 2004 Pearson Addison-Wesley. All rights . | Chapter 2 Data and Expressions © 2004 Pearson Addison-Wesley. All rights reserved 2- Data and Expressions Let's explore some other fundamental programming concepts Chapter 2 focuses on: character strings primitive data the declaration and use of variables expressions and operator precedence data conversions accepting input from the user Java applets introduction to graphics © 2004 Pearson Addison-Wesley. All rights reserved 2- Outline Character Strings Variables and Assignment Primitive Data Types Expressions Data Conversion Interactive Programs Graphics Applets Drawing Shapes © 2004 Pearson Addison-Wesley. All rights reserved 2- Character Strings A string of characters can be represented as a string literal by putting double quotes around the text: Examples: "This is a string literal." "123 Main Street" "X" Every character string is an object in Java, defined by the String class Every string literal represents a String object © 2004 Pearson Addison-Wesley. All rights reserved 2- The println Method In the Lincoln program from Chapter 1, we invoked the println method to print a character string The object represents a destination (the monitor screen) to which we can send output ("Whatever you are, be a good one."); object method name information provided to the method (parameters) © 2004 Pearson Addison-Wesley. All rights reserved 2- The print Method The object provides another service as well The print method is similar to the println method, except that it does not advance to the next line Therefore anything printed after a print statement will appear on the same line See (page 63) © 2004 Pearson Addison-Wesley. All rights reserved 2- String Concatenation The string concatenation operator (+) is used to append one string to the end of another "Peanut butter " + "and jelly" It can also be used to append a number to a string A string literal cannot be broken across two lines in a program

TỪ KHÓA LIÊN QUAN
Đã 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.