草庐IT

ExpandableComposite

全部标签

java - 一个 int 值中的多个标志

我有一个包含多个标志的int变量,例如:intstyles=ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED;我可以测试标志的存在booleanexpanded=(styles&ExpandableComposite.EXPANDED)!=0;如何在不知道stylesstyles中清除标志的值,即动态删除ExpandableComposite.EXPANDED/? 最佳答案 这是一个古老的C习惯用法,在Java