Because the project needs to configure a refresh time in the configuration file, the data taken out of the configuration file is definitely a string, and then the string with the operator is converted to a long type. The specific code is as follows:
In the configuration file:
Reflash_time = (2*60*1000)
The Java code takes out the value:
public static final String reflashtime = "Reflash_time";p ublic string reflashtime;reflashtime = Prop.getproperty ( Reflashtime). Trim ();
The string is split by *, the number is saved in an array, and then multiplied to get its value:
string[] Reflash = Reflashtime.split ("\\*"); for (int i = 0; i < reflash.length; i++) {reflashtime *= Long.parselong (Reflash[i]);} System.out.println (Reflashtime);
This enables the conversion of a string with an operator to an integral type.
This article is from the "forever_love_ing" blog, make sure to keep this source http://dwf07223.blog.51cto.com/8712758/1553663
Java string with operator is converted to long type