package d1;
public class o5 {
public static void main(String[] args) {
String s="fasfa";
if (s.length()>0) {
System.out.println("此字符串不为空");
System.out.println("s = " + s.charAt(0));
System.out.println("字符串的长度为" + s.length());
System.out.println("第一个字符" + s.charAt(0));
}else {
s="adadasad";
System.out.println("此字符串为空赋值为 afasfasf");
System.out.println("字符串的长度为" + s.length());
System.out.println("第一个字符" + s.charAt(0));
}
}
}
07-12
292
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)