I have a problem, when I go to compile the program it says the variable is not initialized. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I have a problem, when I go to compile the program it says the variable is not initialized.

8th Oct 2016, 10:23 PM
Dan Roszhart
6 Answers
0
Give a value = 0 if number, if type text = " "; to begin
8th Oct 2016, 11:33 PM
Wanderlei Borges
Wanderlei Borges - avatar
0
What would it be if it is a char variable.
8th Oct 2016, 11:46 PM
Dan Roszhart
0
= ' ';
8th Oct 2016, 11:49 PM
Wanderlei Borges
Wanderlei Borges - avatar
0
=null or = '';
8th Oct 2016, 11:51 PM
Wanderlei Borges
Wanderlei Borges - avatar
0
better you should give the default value of the data types. byte, short, int and long have default values as 0 float has 0.0f double had 0.0d String has null but for your convince you should use "".
9th Oct 2016, 2:26 PM
Abhinav Maurya
Abhinav Maurya - avatar
0
if you have others inputs, enter all, use enter to another line, after submit
9th Oct 2016, 6:18 PM
Wanderlei Borges
Wanderlei Borges - avatar