java多个线程操作一个静态值问题

public class WebCrawler {
            public static Integer i=0;
            public static void main(String[] args) {
                    BlockingQueue<String>  queue  = new ArrayBlockingQueue<String>(10);
                 for(int i=1;i<11;i++){
                     int page = i * 25 - 1;
                     String page1 = page + "";
                     String url ="https://movie.douban.com/top250?start=" + page1 + "";
                     queue.offer(url);
                 }
                System.out.println(queue);
                Runcrawler r = new Runcrawler();
                r.setUrl("https://movie.douban.com/top250?start=1");
                Runcrawler r1 = new Runcrawler();
                r1.setUrl("https://movie.douban.com/top250?start=50");
                Runcrawler r2 = new Runcrawler();
                r2.setUrl("https://movie.douban.com/top250?start=77");  
                r.start(); 
                r1.start();
                r2.start();
}
  class Runcrawler extends Thread{
    private String url;
    public void setUrl(String url){
        this.url= url;
    }
  public void run(){
         synchronized (i) {
             i++;
        }
}

在run方法里i找不到,我怎么在每个线程里给i+1?


我把i定义在了Runcrawler 这个类里好使,但是这不是同一个对象的i了把= =

查看回复