题目:1、编写电池类(Cell):具有品牌属性,可以续电 2、编写测试类(TestCell) public class CELL { String brond; public void show(){ System.out.println("电池品牌:"+brond); } public static void main... 题目:1、编写电池类(Cell):具有品牌属性,可以续电
2、编写测试类(TestCell)
public class CELL {
String brond;
public void show(){
System.out.println("电池品牌:"+brond);
}
public static void main(String[] args) {
CELL bro=new CELL();
bro.brond="双鹿";
bro.show();
}
}
测试类 应该怎么写?
public class TestClass {
public static void main(String[] args) {
Hello hello = new Hello();
String str = hello.getInfo();
System.out.println(str);
}
}