Java项目中每一个类都可以有一个main方法,但只有一个main方法会被执行,其他main方法可以对类进行单元测试. public class StaticTest { public static void main(String[] args) { Employee[] staff=new Employee[3]; staff[0]=new Employee("Tom",40000); staff[1]=new Employee("Dick",60000); s
1.新建立一个Android工程 package com.shellway.junit; public class Service { public int divide(int a,int b){ return a/b; } } Service.java.作为被测试类 package com.shellway.junit; import junit.framework.Assert; import android.test.AndroidTestCase; public class TestT