ExamVeda
Login
Home
Data Types and Variables
?

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

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

12 Comments
Chetan Dandekar
Chetan Dandekar 2 years ago
STATIC (uppercase) is allowed as a variable name.
static (lowercase) is a reserved keyword and cannot be used as a variable name.
The code will compile successfully and print 2.5 unless you accidentally use the keyword static.
Narasimha Prasad
Narasimha Prasad 6 years ago
Identifiers names is not allowed keywords.How is print?
Faizan Hussain
Faizan Hussain 7 years ago
it is a case sensitive language coz this static is right not this STATIC
Niveditha Tn
Niveditha Tn 7 years ago
Yes....
It's STATIC not static
Karthik Reddy
Karthik Reddy 8 years ago
thx for making me realize the case sensitivity of STATIC
Rishabh Nandwal
Rishabh Nandwal 8 years ago
static is keyword not STATIC
Nisrin Dhoondia
Nisrin Dhoondia 8 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.
Nisrin Dhoondia
Nisrin Dhoondia 8 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).
Manish Shukla
Manish Shukla 9 years ago
plzz explain me how to come ans A
Naser Malikzada
Naser Malikzada 10 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.
Shubhangi Ambekar
Shubhangi Ambekar 10 years ago
Because java is case sensitive. static keyword is there in java not the STATIC.
So answer is option A .
Shubhangi Ambekar
Shubhangi Ambekar 10 years ago
Because java is case sensitive. static keyword is there in java not the STATIC.
So answer is option A .