answersLogoWhite

0

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

Justus Rau

Lvl 10
3y ago

Still curious? Ask our experts.

Chat with our AI personalities

BeauBeau
You're doing better than you think!
Chat with Beau
EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga

Add your answer:

Earn +20 pts
Q: What is the initial value of (-1-17) and (-3-15)?
Write your answer...
Submit
Still have questions?
magnify glass
imp