Java
一只慢慢爬的小蜗牛
这个作者很懒,什么都没留下…
展开
-
Java —— static 修饰的方法不可以覆盖
class Father { public static void go() { } } class son extends Father { public void go() { } }可以看到编译器会发出声明 This instance method cannot override the static method from Father 所以原创 2017-03-20 14:59:22 · 1031 阅读 · 0 评论 -
JAVA 多线程——线程竞争
下面再来看一个关于线程竞争的例子,记得学过了操作系统课程里对线程的进程做过了一定程度的讲解,但当时对于所谓的同步和互斥方法也并不是很了解。最好的方法还是通过代码来理解class Acount { public static int money = 100; public static void save(int count) { money += count;原创 2017-03-20 14:49:01 · 774 阅读 · 0 评论 -
Java——创建进程
关于JAVA多线程的尝试 使用多线程:public class Main { public static void main(String[] args) { MyThread thread1 = new MyThread(); thread1.start(); MyThread thread2 = new MyThread();转载 2017-03-20 13:33:49 · 1015 阅读 · 1 评论