测试代码

package cn.edut.hash.test;

import java.util.Iterator;
import java.util.LinkedList;

public abstract class SSS extends Thread{
	static int i = 0 ;
	
	synchronized void tst() {} ;
	
	@Override
	public void run() {
		tst();
	}
	
	public static void main(String[] args) throws Exception {
		int n = 1000 ; 
		LinkedList<Thread> list = new LinkedList<>();
		for(int i=0 ; i<n; i++) {
			BBB bbb = new BBB();
			list.add(bbb);
			list.getLast().start();
		}
		
		Iterator<Thread> it = list.iterator();
		while(it.hasNext()) {
			it.next().join();
		}
		System.out.println(i);
	}
	
}


class BBB extends SSS{

	void tst() {
		i++;
	}
}

测试

如果继承了synchronized 结果应该是1000