这个代码中@Override public class HelloActivity extends Activity {/** Called when the activity is first created.*/@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);TextView tv = new TextView(this);tv.set

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 00:45:06

这个代码中@Override public class HelloActivity extends Activity {/** Called when the activity is first created.*/@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);TextView tv = new TextView(this);tv.set
这个代码中@Override
public class HelloActivity extends Activity {
/** Called when the activity is first created.*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello,World!");
this.setContentView(tv);
}

这个代码中@Override public class HelloActivity extends Activity {/** Called when the activity is first created.*/@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);TextView tv = new TextView(this);tv.set
@Override表示重写(也叫覆盖).是Java新规范里面的一个注解应用,也就是注释了,告诉你这个方法是重写了父类的一个方法.