3.2.6. Java源码文件

优质
小牛编辑
124浏览
2023-12-01

3.2.6.Java源码文件

Java代码是整个程序的驱动者。它会被编译为可执行格式,在Dalvik之上执行。

例 3.5. HelloWorld.java

package com.marakana;

import android.app.Activity;

import android.os.Bundle;

public class HelloWorld extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.main);

}

}