早教吧 育儿知识 作业答案 考试题库 百科 知识分享

java英语单选题whichmodifiershouldbeapplidetoamethodforthelockofobjectthistobeobtainedpriortoexecutionanyofthemethodbody?a:synchronizedb:abstractc:finald:statice:publicwhichmodifiershouldbeappliedt

题目详情
java英语单选题
which modifier should be applide to a method for the lock of object this to be obtained prior to execution any of the method body?
a:synchronized b:abstract c:final d:static e:public
which modifier should be applied to a method for the lock of object this to be obtained prior to execution any of the method body?
▼优质解答
答案和解析
为了让固定的对象this在执行一个方法体之前就被得到(取得),下面哪个修饰符 应该用来修饰 这个方法 ??synchronized 方法控制对类成员变量的访问:每个类实例对应一把锁(this),每个 synchronized 方法都必须获...