Examveda
Examveda

int ++a = 100 ; 
System.out.println( ++a ) ;

What will be the output of the above fraction of code ?

A. 100

B. Displays error as ++a is not enclosed in double quotes in println statement

C. Compiler displays error as ++a is not a valid identifier

D. None of these

Answer: Option C


This Question Belongs to Java Program >> Operators

Join The Discussion

Comments ( 5 )

  1. Sanjana Shridhar
    Sanjana Shridhar :
    3 years ago

    Identifier should only start with alpha character or with special characters such as _ and $

  2. Md Murad
    Md Murad :
    3 years ago

    operator symbol is not allowed with variable therefore, it will give you compile time error

  3. Rekha Akter
    Rekha Akter :
    6 years ago

    please explain that what will do to print?

  4. Chhavi Chaudhary
    Chhavi Chaudhary :
    6 years ago

    As ++a is identifier(referance variable)....so according to java we cant declare referance variable using operator's symbol...

  5. Somasekharreddy Dronadula
    Somasekharreddy Dronadula :
    6 years ago

    please give explination to this problem

Related Questions on Operators