JAVA编程 - 字符型、字符串、字符串数组(完整版解读)

1、 字符串数组,并且其中元素数目大于1

strs = ["10", "0001", "111001", "1", "0"]

那么求其长度为

int lengths = strs.length;
int len = strs[i].length();

如何取值

String str = strs[i];//则str = "0001"
//如何去str中任意的元素暂时还不会

 

2、JAVA字母输入

Scanner x=new Scanner(System.in);
char a=x.nextchar();

 

posted @ 2021-03-10 11:07  被梦想尘封的时光  阅读(313)  评论(0编辑  收藏  举报