Adobe Interview Question
Applications DevelopersCountry: India
Compilation error because:
- with volatile you tell the compiler that you'll eventually assign value to the variable (which will cause cache flushes, reordering should not happen etc. - and it is important for compiler/runtime to know about it) .
- with final you tell the compiler that the field will never be modified after it is explicitly initialized
i think it will be a compilation error...
- CrazyCoder April 29, 2012bacause final means you can not change the value of variable..and volatile means value of variable can also be changed from outside sources (apart from immediate code)...