avatar
@Override annotation.# Java - 爪哇娇娃
i*p
1
Eclipse asks me to remove "@Override" for afterTextChanged(),
beforeTextChanged() and onTextChanged(). However, the same code in the
Eclipse working on another working space has no problem.
Does anybody know the reason?
public class myActivity extends Activity implements TextWatcher
{
@Override
public void onCreate(Bundle savedInstanceState) {
...
}
@Override
public void afterTextChanged(Editable msg) {
....
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int
after) {
.......
}

@Override
public void onTextChanged(CharSequence s, int start, int before, int
count) {
.....
}
avatar
Z*Z
2
jdk version?

【在 i**p 的大作中提到】
: Eclipse asks me to remove "@Override" for afterTextChanged(),
: beforeTextChanged() and onTextChanged(). However, the same code in the
: Eclipse working on another working space has no problem.
: Does anybody know the reason?
: public class myActivity extends Activity implements TextWatcher
: {
: @Override
: public void onCreate(Bundle savedInstanceState) {
: ...
: }

avatar
i*w
3
正解,这个annotation在1.6才可以用在interface上

【在 Z*****Z 的大作中提到】
: jdk version?
avatar
i*p
4
Thank you two! You are right. My Eclipse sets the project to use 1.5 by
default.

【在 i**w 的大作中提到】
: 正解,这个annotation在1.6才可以用在interface上
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。