Turn from:
Http://www.blogjava.net/ljc-java/archive/2011/02/28/345344.html
1.Integer Convert to int method
Integer i = new Integer (10);
int k = I.intvalue ();
namely Integer.intvalue ();
2.int Convert to Integer
int i = 10;
Integer it = new Integer (i);
3.String Convert to int method
String str = "10";
Integer it = new Interger (str);
int i = It.intvalue ();
That is: int i = Integer.intvalue (string);
4.int Conversion to String
int i = 10;
(1) String s = string.valueof (i);
(2) String s = ingeger.tostring (i);
(3) String s = "" + I;
5.String Convert to Integer
String str = "10";
Integer it = integer.valueof (str);
6.Integer Conversion to String
Integer it = new Integer (10);
String str = it.tostring ();
7.String conversion to BigDecimal
BigDecimal bd = new BigDecimal (str);
8. Date
Calendar calendar = Calendar.getinstance ();
int year = Calendar.get (calendar.year);
int month = Calendar.get (calendar.month) +1;
int day = Calendar.get (calendar.date);
Get today's date string
String today = java.text.DateFormat.getDateInstance (). Format (new java.util.Date ());
Get today's date
New Java.sql.Date (System.currenttimemillis ());
Conversions between string, Integer, int in Java data type