answersLogoWhite

0

Any letter of the Greek or Roman alphabet, or any other alphabet can be used to represent a variable. There are also non-alpha symbols, for example for the Dirac constant (or reduced Planck constant).

User Avatar

Wiki User

9y ago

Still curious? Ask our experts.

Chat with our AI personalities

TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao

Add your answer:

Earn +20 pts
Q: What is the special symbol allowed in a variable name?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why variable names are restricted?

To make the compiler/interpreter's work easier. In a happier word any kanji symbol or punctuation mark could be a variable name (or even a space!).


Can keyword be used as variables?

No, any keyword could be used as a identifier (a method, class or variable name). These keywords have a special meaning in the language and the compiler can not identify if they are used as a variable name or as a keyword,


Which data structure in a compiler is responsible for managing information about variables and their attributes?

It is up to the designer of the compiler to decide... it can be something like this: struct Type; struct Block; typedef struct Variable { const char *name; struct Type *type; struct Block *block; /* refers to the block that is the scope of the variable */ int attributes; /* volatile, const, static etc */ } Variable;


What is Variable Shadowing in Java?

In Java, there are three kinds of variables: local variables, instance variables, and class variables. Variables have their scopes. Different kinds of variables have different scopes. A variable is shadowed if there is another variable with the same name that is closer in scope. In other words, referring to the variable by name will use the one closest in scope, the one in the outer scope is shadowed.A Local Variable Shadows An Instance VariableInside a class method, when a local variable have the same name as one of the instance variable, the local variable shadows the instance variable inside the method block.


Is a global variable a non-local variable?

True, a variable cannot be both global and local. But if a global and a local variable share the same name, the local one will hide the global.