Which of the following is a valid long literal - Study24x7
Social learning Network
study24x7

Default error msg

Login

New to Study24x7 ? Join Now
Already have an account? Login
04 Jan 2021 02:21 PM study24x7 study24x7

Which of the following is a valid long literal

A

ABH8097

B

L990023

C

904423

D

0xnf029L

study24x7
Write a comment
  • Edubabble LLP
  • For every long literal to be recognized by Java, we need to add L character at the end of the expression. It can be either uppercase (L) or lowercase (l) character. However, it is recommended to use uppercase character instead of lowercase because the lowercase (l) character is hard to distinguish from the uppercase (i) character.
    For example,
    Lowercase l: 0x466rffl
    Uppercase L: 0nhf450L
    Hence, the correct answer is an option (d).

    See more

    Related Questions
    500+   more Questions to answer
    Most Related Articles