+ 2
In java,when System.out.println{12345+5432l} output is 17777.In these case L is char or string.and can sum with integers?
what is possible ans?
7 Answers
+ 5
???
Can you show me a code with that?
+ 5
Ohh the same as rust
fn main() {
let x = 10i32;
}
+ 3
You used the wrong bracket :>.
Anyway, L will make the number of type long.
So, 5432L is a long with the value of 5432.
Adding the numbers together gives you 17777. Of type long.
That's really it.
It's the same as doing:
float a = 12.5f; // 12.5 is a float
double b = 0.5; // 0.5 is a double
print(a+b);
All regular whole numbers are by default of type int.
So, the L was used to indicate that it is actually a long.
+ 2
Or:
double var = 5 * 3d; // 15.0 (d -> double)
+ 1
thank u for ur ans
+ 1
@MrCoder
What's the i supposed to be? Int is the default whole number, there is no need for i.
0
@Restoring faith Late reply lol, Declaring numbers in Rust is unpredictable, it can be f32, i32, i64, i8, and many more