Free Assignments via E-mail

Enter your email address:

Subscribe the blog by your Email ID for the SMU MBA assignments updates.

Saturday, February 19, 2011

There is a solve question of – “Explain the various rules for naming a variable in Java? Give one example for each.” You can take it for Sikkim Manipal University (SMU) MBA Assignment MI0032. You can see some SMU MI0032 assignments also like Ecommerce Opportunities for Industries and QR System of Wal-Mart and Functions of Supply Chain Management.

Java allocates memory to each variable and constant you use in your program. As in algebra, the values of variables may change in a program, but the values of constants, as the name suggests, do not change. You must assign unique names to variables and constants. Variables names are used in a program in much the same way as they are in ordinary Algebra.

Each variable used in a program must be declared. That is to say, the program must contain a statement specifying precisely what kind of information (data type) the variable will contain. This applies to every variable used in the program, regardless of the type.

Naming Variables:

A program refers to a variable using its name. Certain rules and conventions govern the naming of variables. You must adhere to rules. Conventions help improve the readability of the program, but following them is not mandatory.

Rules for Naming Variables in Java:

A variable name:

Must not be a keyword in Java.
Must not begin with a digit.
Must not contain embedded spaces.
Can contain characters from various alphabets, like Japanese, Greek and Cyrillic.

When you learned algebraic equations in school, you used x and y to represent values in equations. Unlike pi which has a constant value of 3.14, the values of x and y not constant in equations. Java provides constants and variables to store data in programs. You can elaborate it also more by yourself.

0 comments:

New MBA Assignments

Opinions on MBA Assignments