How to code the data types


How do I code the data types?


Depending on your data type, this is the syntax:
dataType var_name = value;

For example:

int number = 15;
String my_string = "foobar";
float my_float = 3.14;

A more advanced data type could be something like this:

HashMap<String, Integer> my_hashmap = new HashMap<String, Integer>();
ArrayList<Integer> my_arraylist = new ArrayList<Integer>();


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.