持续更新
书籍类
1、Head First Java
这本书写得很有意思,用的范例也很简洁明了。初学用来提升兴趣很不错。
书中的源码可以到作者提供的网站下载:https://www.wickedlysmart.com/books/
网站类
1、how2j网
可以跟着实践学习
https://how2j.cn/
2、java编程思想作者个人网站
https://www.bruceeckel.com/
部分demo
random会产生0.0吗?
//《think in java》
//启动方式:java RandomBounds lower/upper
//若直接使用java RandomBounds,则直接调用usage()
public class RandomBounds{
static void usage(){
System.err.println("Usage:\n\t"+"Randombounds lower\n\t"+"Randombounds upper\n\t\n\t");
System.exit(1);
}
public static void main(String[] args){
if(args.length != 1)
usage();
if(args[0].equals("lower")){
while(Math.random() != 0.0)
System.out.println("Produced 0.0");
}
else if(args[0].equals("upper")){
while(Math.random() != 0.0)
System.out.println("Produced 1.0");
}
else
usage();
}
}