Variable Types


  1. Which of these can not be used for a variable name in Java?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    Keywords are specially reserved words which can not be used for naming a user defined variable, example : class, int, for etc.


  1. Literal can be of which of these data types?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Literal can be integer, float and boolean.



  1. Literals in java must be appended by which of these?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Data type long literals are appended by an upper or lowercase L.


  1. Which of these can be returned by the operator & ?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    We can use binary ampersand operator on integers/chars (and it returns an integer) or on booleans (and it returns a boolean).



  1. Which of these is long data type literal?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Data type long literals are appended by an upper or lowercase L. 0x99fffL is hexadecimal long literal.