Which of the following are valid variable names? If they are not valid names, briefly explain why. 4 4a a4 did do do dodo desire2Learn DESIRE2LEARN one-Hundred One_Hundred Create a program: to display the minimum value that can be assigned to each integer data type. You should be able to guess the names of these variable; to modify the program so that aBoolean primitive data type has a different value; to modify the program so that the char primitive data type outputs a lowercase letter and the statement reflects this. Just show me the code of the program.
Generally, dashes and spaces can't be used because they mean other things. Similarly, variable names usually cannot start with numbers. So this excludes these 4. 4 4a did do one-Hundred
Valid Variable Names: 4a a4 do dodo desire2Learn DESIRE2LEARN One_Hundred Invalid variable Names: 4 4a did do one-Hundred Reason: * Variable name should start with any character or underscore (_) * It should not start with number * special characters are not allowed anywhere in the variable name except underscore(_) & dot(.) * white spaces are not allowed in variable name In the four invalid variable mentioned by me are invalid because: 4 : starting with a digit 4a : starting with a digit did do: white spaces are not allowed one-Hundred : speccial characters are not allowed ( '-' is used here)
Join our real-time social learning platform and learn together with your friends!