摘要:
String类型可以有两种方式创建; 1.构造方法: char[] chs = {'a','b','c'}; String s1 = new String(chs); 2.直接赋值: String s3 = "abc"; 两者的区别就是,使用构造方法创建的对象,值相同的话内存地址不同,而使用直接赋值 阅读全文
摘要:
阅读全文
摘要:
创建一个类 public class Phone { //成员变量 String brand; int price; //成员方法 public void call(){ System.out.println("打电话"); } public void sendMessage(){ System.o 阅读全文