Examveda
Examveda

The following fraction of code
double STATIC = 2.5 ;
System.out.println( STATIC );

A. Prints 2.5

B. Rraises an error as STATIC is used as a variable which is a keyword

C. Raises an exception

D. None of these

Answer: Option A


This Question Belongs to Java Program >> Data Types And Variables

Join The Discussion

Comments ( 11 )

  1. Narasimha Prasad
    Narasimha Prasad :
    4 years ago

    Identifiers names is not allowed keywords.How is print?

  2. Faizan Hussain
    Faizan Hussain :
    4 years ago

    it is a case sensitive language coz this static is right not this STATIC

  3. Niveditha Tn
    Niveditha Tn :
    5 years ago

    Yes....
    It's STATIC not static

  4. Karthik Reddy
    Karthik Reddy :
    5 years ago

    thx for making me realize the case sensitivity of STATIC

  5. Rishabh Nandwal
    Rishabh Nandwal :
    6 years ago

    static is keyword not STATIC

  6. Nisrin Dhoondia
    Nisrin Dhoondia :
    6 years ago

    Java is case-sensitive. Thus a word static and STATIC holds different meaning in Java, where static is a reserved keyword, the same word STATIC (in uppercase) can also be used as variable name too. But to avoid ambiguity in program it is advisable not to reuse reserved keywords of Java.

  7. Nisrin Dhoondia
    Nisrin Dhoondia :
    6 years ago

    Java is case-sensitive. And so all the predefined and user-defined identifiers (i.e. class name, method name and variable name) and keywords in Java are case-sensitive. Thus a word static and STATIC holds different meaning in Java, where static is a reserved keyword, the same word STATIC (in uppercase) can also be used as variable name too. But to avoid ambiguity in program it is advisable not to reuse words which are predefined (keywords, class name, interface name, method name and variable name) or user-defined (class name, method name and variable name).

  8. Manish Shukla
    Manish Shukla :
    7 years ago

    plzz explain me how to come ans A

  9. Naser Malikzada
    Naser Malikzada :
    7 years ago

    Because java is case sensitive ,therefore static keyword is used in java and so STATIC is a variable name.
    The correct option is A.

  10. Shubhangi Ambekar
    Shubhangi Ambekar :
    8 years ago

    Because java is case sensitive. static keyword is there in java not the STATIC.
    So answer is option A .

  11. Shubhangi Ambekar
    Shubhangi Ambekar :
    8 years ago

    Because java is case sensitive. static keyword is there in java not the STATIC.
    So answer is option A .

Related Questions on Data Types and Variables