Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 97f4254

Browse files
Update README.md
1 parent af01783 commit 97f4254

File tree

1 file changed

+20
-0
lines changed
  • textbook work/java software solutions/2. Data and Expressions

1 file changed

+20
-0
lines changed

‎textbook work/java software solutions/2. Data and Expressions/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,22 @@ introduce the concepts of graphical programming, explore the relationship betwee
1515

1616
![image](https://user-images.githubusercontent.com/19383145/145282105-dcc71c0e-7986-4353-92e4-4084d16650c4.png)
1717

18+
### Java widening conversions
19+
20+
![image](https://user-images.githubusercontent.com/19383145/145308271-40fdad13-9fa8-451e-9462-83e95661daf4.png)
21+
22+
- Widening conversions are the safest because they usually do not lose information. They are called widening conversions because they go from one data type to another type that uses an equal or greater amount of space to store the value.
23+
- All widening conversions that go from an integer type to another integer type, or from a floating point type to another floating point type, preserve the numeric value exactly
24+
- Although widening conversions do not lose any information about the magnitude of a value, the widening conversions that result in a floating point value can lose precision.
25+
- When converting from an int or a long to a float , or from a long to a double , some of the least significant digits may be lost.
26+
27+
### Java narrowing conversions
28+
29+
![image](https://user-images.githubusercontent.com/19383145/145308814-b64699b9-79bd-40a2-8c8e-cfeace9697bf.png)
30+
- Narrowing conversions are more likely to lose information than widening conversions are.
31+
- They often go from one type to a type that uses less space to store a value, and therefore some of the information may be compromised.
32+
- Narrowing conversions can lose both numeric magnitude and precision. Therefore, in general, they should be avoided.
33+
1834
### some methods for scanner class
1935

2036
![image](https://user-images.githubusercontent.com/19383145/145293239-70c70f56-4445-43c0-98b2-e42c17c97f16.png)
@@ -23,3 +39,7 @@ introduce the concepts of graphical programming, explore the relationship betwee
2339

2440
![image](https://user-images.githubusercontent.com/19383145/145308034-505865ba-5651-4222-ac15-a301fe0ae1a4.png)
2541

42+
### A traditional coordinate system and the Java coordinate system
43+
44+
![image](https://user-images.githubusercontent.com/19383145/145309391-3ac9b9ca-64e6-4a33-957b-3e6e2ea0f1a4.png)
45+

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /