Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我尝试在静态字段上使用 Eclipse 自动下推重构时,出现错误:
“要激活此重构,请选择非二进制实例方法或字段的名称。”
当我删除 static 关键字时,重构可以继续进行。eclipse 所说的“二进制域”是什么意思,为什么存在这个限制?
由于静态字段/方法仅属于该类,因此您不能将其下推到子类。
如果A是 的超类,那么对于被调用B的静态方法,只能用 as ,不能用 as 。下推这个方法肯定会改变类在做什么,影响程序的意义。AaA.aB.a
A
B
a
A.a
B.a