answersLogoWhite

0


Best Answer

When we talk about instance variables, the default initial value for a numeric variable is always '0'. Any other variable in your code must be initialized before you can use it.

public class MyClass{

public int x; // 0 by default

public float y: // 0 by default

public MyClass{

int z;

z++; // Error 'z' don't have a default value

}

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the initial value of a numeric variable?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is initial variable?

Variable initialization is the assignment of an initial value to a variable.


Random variable that can take any numeric value within a range of values?

continuous random variable


What is the initial value of (-1-17) and (-3-15)?

When we talk about instance variables, the default initial value for a numeric variable is always '0'. Any other variable in your code must be initialized before you can use it. public class MyClass{ public int x; // 0 by default public float y: // 0 by default public MyClass{ int z; z++; // Error 'z' don't have a default value } }


What two things must you nor normally specify in a variable declaration?

In most programming languages, you do not need to specify the variable's type and initial value in a variable declaration. The type is usually inferred from the assigned value, and the initial value can be set separately if needed.


What is the default initial value for all numeric types?

If they are instance variables the default initial value is 0. If they are method local variables, they are null and must be initialized to some value before they are used


How can assign a value to a variable in GB Basic?

to simply assign a variable a numeric value a=10 anything=12 etc for string variables a$="sweet" ex$="happy christmas" etc to assign a value by input input"enter numerical value";numeric input"enter string value";string$ i hope that clears it up


What is numeric x in statistics?

In statistics, letter such as; a,..x..,z, is a variable used to represent an unknown value.


How do you declare a variable with initial value of 20.1234?

float myVariable = 20.1234;


How do you enter a numeric value for the initial page file size?

Nu reușesc să resetez Page file ! Nu știu cum să introduc Numeric value for initial page file size. Am RAM instalat 2 GB, mulțumesc pentru ajutor!


What is the difference between data and variable?

data type refers to the kind of value that is held by a particular variable. For ex: an int variable contains integer value, a string holds a alpha numeric value etc. variable refers to the name of a value using which we can refer to this value. Ex: public int age = 28; here int is the data type and age is the variable.


Define the numeric value of perception?

numeric perception is a value of perception to the numeric value


What value is assigned to extern variable?

Default initial value of extern integral type variable is zero otherwise null.