Java中new的问题
初学Java..有个疑惑。请大神解决。
不明白有没有new有什么区别。比如
String [][] names=new String [][]{{"tom","jack","mike"},{"zhangsan","lisi","wangwu"}};
和这句
String [][] names={{"tom","jack","mike"},{"zhangsan","lisi","wangwu"}};
为什么不能用下面这句,而是写成上面那句的形式?
初学Java..有个疑惑。请大神解决。
不明白有没有new有什么区别。比如
String [][] names=new String [][]{{"tom","jack","mike"},{"zhangsan","lisi","wangwu"}};
和这句
String [][] names={{"tom","jack","mike"},{"zhangsan","lisi","wangwu"}};
为什么不能用下面这句,而是写成上面那句的形式?
2016-12-30
举报