Suppose code is given like this:
pattern_mask[pattern[i]] &= ~(1UL << i);
What kind of type is this in Java? How do I implement this in Java?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Java does not have unsigned
long, but1Lis a 64-bit signedlongliteral.References
long, from-9223372036854775808to9223372036854775807, inclusivelongif it is suffixed with an ASCII letterLorl(ell); otherwise it is of typeint. The suffixLis preferred, because the letterl(ell) is often hard to distinguish from the digit1(one).On masking of count operand
The shift count is masked: only lower 5-bits for
intshift, and only lower 6-bits forlongshift.The following snippet shows how due to this, shifting on
1is different from shifting on1L.Related questions