Does java contain auto or register keywords? A. Yes, for declaring

does-java-contain-auto-or-register-keywords-a-yes-for-declaring

Does java contain auto or register keywords?

A. Yes, for declaring every type of variable

B. Yes, only to declare cache registers

C. No, because java doesn’t support automatic variables

D. No, java supports local variable concept

I have been asked this question in homework.

My query is from Automatic Variable in chapter Memory Allocation & Scope of Variable of Object Oriented Programming

Correct choice is D. No, java supports local variable concept

Explanation: The auto and register keywords are not supported in java. Though the same is allowed in java without specifying any of those keywords. The variables are local variables. But java makes it mandatory to initialize all of the local variables in a program.