0

Which type of variable we will use if we have both integers and alphabets in a same 'variable'..?

7th Feb 2017, 12:35 AM
Muhammad Ahsan
Muhammad Ahsan - avatar
2 Answers
+ 3
String, or, singularly, char. The collective term is alphanumeric.
7th Feb 2017, 1:06 AM
Leon
Leon - avatar
0
you'd better use this - class main { public static void main(String arcs[]) { Variable variable = new Variable(); variable.integer = 11; variable.string = "s"; } } public class Variable { int integer; String string; public Variable () { this.integer = 0; this.string = ""; } }
7th Feb 2017, 1:08 AM
Thomas Sudeep Benardo