+ 3
How can you create a variable in java that can hold all data types or int and String?
6 Answers
+ 2
You can do it in Java by using the "var" keyboard this works like python you don't have to define int or String or any other data type, or you can use Object class which works pretty much the same but it's a class with this you can for example create an array which will look like that: [int, char, String]
+ 3
Eliya Ben Baruch thank you for the answer I really appreciate it, you have not taught me alone but Prabhat Ranjan also who says java does not have such a feature.
+ 2
This feature is only supported in python and not in Java
+ 2
So how can you write a program that collects users email address which usually contains symbols, numbers and alphabets?
+ 2
By using strings
But strings does not means that it can accept values of all data types. It is just a collection of characters
+ 2
I now get it, it wasn't working at first thanks