java关键字

  • Post author:
  • Post category:java


abstract

abstract method ,包含abstract method的class必须声明为abstract


synchronized


标记临界区,保护共享资源。


Java synchronized keyword

marks a block or method a critical section. A critical section is where one and only one thread is executing at a time, and the thread holds the lock for the synchronized section.

public void println(char x[]) {
        synchronized (this) {
            print(x);
            newLine();
        }
    }



版权声明:本文为weixin_37573425原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。