Computer Science, asked by vikassonkar200pc7ctv, 1 year ago

what are the rules to assign a variable in a java programming

Answers

Answered by keerthanaponraj
16

the rules for assigning a variable are :-

1.the variable should always begin with an alphabet or an underscore.

2. the variable name cannot include spaces.

3. the name cannot include keywords

4. They are case sensitive. Hence small and capital A have different meanings


please mark brainliest answer

Answered by Saloni001
5

SOME RULES ARE-

1.DONT USE ANY RESERVED KEYWORD AS A VARIABLE . IT CAN BE VAGUE BECOZ JAVA IS A RESERVED LANGUAGE AND ALSO CASE SENSITIVE.

2.THE VALUE WHILE ASSIGNING A VARIABLE MUST NOT CHANGE .

3.ALSO THE VARIABLE NAME IS IF TWO AND SEPERATE THEM ONLY BY UNDERSCORE (_).FOR EXAMPLE-WELCOME_INDIA


HOPE IT HELPED

WELL!!! NOT FORCING U TO MARK AS BRAINLIEST ....BUT STILL IF U LIKED U CAN MARK!:-)


Similar questions