jdk7新增了许多特性,下面我来简单介绍几个。 1,Switch语句的改进:在jdk7之前,Switch语句只能支持整型、枚举类型的判断,而jdk7新增了支持字符串类型的判断。这样在编写代码的时候会更加方便,不需要再使用一堆的if-else语句来替代。例如: switch(fruit){ case"apple": System.out.println("Thisisanapple"); break; case"banana": System.out.println("Thisisabanana"); break; default: System.out.println("Unknownfru...

关注 更多

空空如也 ~ ~

粉丝 更多

空空如也 ~ ~