java - What means 1L serialVersionUID? When could I use this default . . . The 1L has no special meaning It is just a number that will match 1L as the "other" version id To my mind, you are better off either using 0L, or a version number that was (at some point) generated using the standard algorithm If you use 0L, then you get definite deserialization exceptions if classes change in ways that could be source of
What is -1L 1L in C? - Stack Overflow The L specifies that the number is a long type, so -1L is a long set to negative one, and 1L is a long set to positive one As for why ftell doesn't just return NULL, it's because NULL is used for pointers, and here a long is returned Note that 0 isn't used because 0 is a valid value for ftell to return
java - Difference between 1L and (long) 1 - Stack Overflow (long) 1 evaluates to the same constant as 1L However in the first case the number (1) is evaluated as integer whereas 1L is always a long Therefore (long) 123_123_123_123 is invalid since "123_123_123_123" is outside of the integer range, whereas 123_123_123_123L is valid –
c - clarity of -1L lt; 1U and -1L gt; 1UL - Stack Overflow In former example value of expression is 1 as -1L < 1L In latter case -1L is promoted to unsigned type by repeatedly adding or substracting n+1, when n is the largest value of type unsigned long (in your case n+1 == 2^32), which yields into large number (i e 2^32-1), thus value of whole expression is 1 (of type int) as well
Javas L number (long) specification - Stack Overflow -1L >>> 1 ? or (int)-1 >>> 1 ? So even if the number is in the common range, we need to specify type If the default changed with magnitude of the literal, then there would be a weird change in the interpretations of expressions just from changing the digits
Why generate long serialVersionUID instead of a simple 1L? @coobird This seems to be the main reason why the default serialVersionUID is not recommended Note - It is strongly recommended that all serializable classes explicitly declare serialVersionUID values, since the default serialVersionUID computation is highly sensitive to class details that may vary depending on compiler implementations, and can thus result in unexpected serialVersionUID conflicts during deserialization, causing deserialization to fail
java - Static Final Long serialVersionUID = 1L - Stack Overflow what is meant by that in a servlet (private static final long serialVersionUID = 1L)? I have 1 simple question about this guided program given by our professor I have seen serialVersionUID several times but I dont what's that for
c++ - What does (~0L) mean? - Stack Overflow @Noitidart it can be -1L but you can think of it like this If a 64bit 0L is 8 bytes all zeros (and each byte's 8 bits are zeros), then the ~0L operation means you take all the 0 bits in those bytes and turn them to 1's So for each byte that starts as [00000000] in bits, the result is [11111111] –