java String parse to int

String parse to Int

1.method 1:use Integer package class, static method parseInt()

int i;

String s;

i=Integer.parseInt(s);

 

2.method 2:use (int)

int i;

String s;

i=(int)s;

 

Int parse to String

 

posted @ 2022-07-10 23:56  MikeLi  阅读(68)  评论(0编辑  收藏  举报