freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

chapter2primitivedatatypesandoperations-全文預(yù)覽

  

【正文】 m p u t e r s , P r o g ra m s , a n d J a v a Ch a p t e r 2 P ri m i t i v e D a t a T y p e s a n d O p e ra t i o n s Ch a p t e r 4 L o o p s Ch a p t e r 6 A rra y s Ch a p t e r 5 M e t h o d s Ba s i c c o m p u t e r s k i l l s s u c h a s u s i n g W i n d o w s , In t e r n e t E x p l o re r, a n d M i c r o s o f t W o rd 167。 ). ? To use identifiers to name variables, constants, methods, and classes (167。 ). ? To declare Java primitive data types: byte, short, int, long, float, double, and char (167。 ). ? (Optional) To obtain input from console (167。 ). Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 3 Introducing Programming with an Example Listing Computing the Area of a Circle This program putes the area of the circle. ComputeArea Run IMPORTANT NOTE: To run the program from the Run button, (1) set c:\Program Files\java\\bin for path, and (2) install slides from the Instructor Resource Website to a directory (., c:\LiangIR) . Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 4 Trace a Program Execution public class ComputeArea { /** Main method */ public static void main(String[] args) { double radius。 // Display results (The area for the circle of radius + radius + is + area)。 // Compute area area = radius * radius * 。 // Assign a radius radius = 20。 double area。 } } 20 radius memory area pute area and assign it to variable area animation Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 8 Trace a Program Execution public class ComputeArea { /** Main method */ public static void main(String[] args) { double radius。 // Display results (The area for the circle of radius + radius + is + area)。 // Compute the second area radius = 。 // Declare x to be an // integer variable。 // Declare a to be a // character variable。 // Assign to radius。A39。 Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 14 Constants final datatype CONSTANTNAME = VALUE。 displays , not , and ( )。 Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 23 Integer Literals An integer literal can be assigned to an integer variable as long as it can fit into the variable. A pilation error would occur if the literal were too large for the variable to hold. For example, the statement byte b = 1000 would cause a pilation error, because 1000 cannot be stored in a variable of the byte type. An integer literal is assumed to be of the int type, whose value is between 231 (2147483648) to 231–1 (2147483647). To denote an integer literal of the long type, append it with the letter L or l. L is preferred because l (lowercase L) can easily be confused with 1 (the digit one). Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 24 FloatingPoint Literals Floatingpoint literals are written with a decimal point. By default, a floatingpoint literal is treated as a double type value. For example, is considered a double value, not a float value. You can make a number a float by appending the letter f or F, and make a number a double by appending the letter d or D. For example, you can use or for a float number, and or for a double number. Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 25 Scientific Notation Floatingpoint literals can also be specified in scientific notation, for example, +2, same as , is equivalent to , and is equivalent to . E (or e) represents an exponent and it can be either in lowercase or uppercase. Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 26 Arithmetic Expressions )94(9))(5(105 43 y xxx cbayx ????????is translated to (3+4*x)/5 – 10*(y5)*(a+b+c)/x + 9*(4/x + (9+x)/y) Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 27 Example: Converting Temperatures Write a program that converts a Fahrenheit degree to Celsius using the formula: FahrenheitToCelsius Run )32)(( 95 ?? f a h r e n h e i tc e l s i u sLiang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 28 Shortcut Assignment Operators Operator Example Equivalent += i += 8 i = i + 8 = f = f = f *= i *= 8 i = i * 8 /= i /= 8 i = i / 8 %= i %= 8 i = i % 8 Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 29 Increment and Decrement Operators Operator Name Description ++var preincrement The expression (++var) increments var by 1 and evaluates to the new value in var after the increment. var++ postincrement The expression (var++) evaluates to the original value in var and increments var by 1. var predecrement The expression (var) decrements var by 1 and evaluates to the new value in var after the decrement. var postdecrement The expression (var) evaluates to the original value in var and decrements var by 1. Liang, Introduction to Java Programming, Sixth Edition, (c) 2020 Pearson Education, Inc. All rights reserved. 0132221586 30 Increment
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1