I liked the lessons about type conversion, unfortunately I found the information provided by CodeGym rather poor.
I was wondering if anybody would be kind enough to explain in more depth this exercise. I spent about an hour trying various conversions but some elements, such as 1234_564_890L; 0b1000_1100_1010; these numbers are beyond my comprehension.
Thank you!
Andrei
Level 41
Very interesting task but hard to understand without proper information provided by CodeGym. Pls help us, wise torchbearers of CodeGym!
Resolved
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
miguel
23 November 2021, 18:18
Yes, I don't know why don't they explain that about those strange numbers before that an exercise.
0
Nouser
17 November 2020, 10:43useful
Wikipedia article.
And I'm not sure if you know how binary numbers work as you mentioned them in your questions. If not, have a look at that +4
Andrei
17 November 2020, 11:03
HI, Nouser, thank you for your detailed answer!
I am familiar with the basics of type conversion and formatting, like you mentioned in lines 1,2,3,5 and 6.
What is not clear to me is the purpose of L at the end of the first number and the b after the 0 in the second number.
The article was very interesting, thank you!
0
Nouser
17 November 2020, 11:05solution
L defines that number as a long. A literal in Java is an int otherwise.
reading for you.
If you need to know more about primitives then Oracle has excellent +5