摘要:
不需要父类,只要子类时。 阅读全文
posted @ 2021-03-10 21:37
谷先生
阅读(47)
评论(0)
推荐(0)
摘要:
Java类体中的成员变量可以分为实例变量和类变量。其中类变量需用static修饰, 否则则为实例变量。类变量又称为static变量或者静态变量 public class StaticText { public static void main(String[] args) { staT.name=" 阅读全文
posted @ 2021-03-09 21:58
谷先生
阅读(53)
评论(0)
推荐(0)
摘要:
多态性的使用 public class AnimalTest { public static void main(String[] args) { AnimalTest test =new AnimalTest(); test.func(new Cat()); test.func(new Dog() 阅读全文
posted @ 2021-03-09 20:05
谷先生
阅读(69)
评论(0)
推荐(0)
摘要:
阅读全文
posted @ 2021-03-08 21:55
谷先生
阅读(30)
评论(0)
推荐(0)
摘要:
一、继承的好处 继承的格式 规定 阅读全文
posted @ 2021-03-08 20:36
谷先生
阅读(137)
评论(0)
推荐(0)
摘要:
JAVA中的变量为什么要初始化呢 在类中定义的成员变量如果你没有初始化java会自动帮你初始化,如果是数字会自动初始化成0,字符会初始化成'o',对象引用会初始化成null. 当然如果你定义的是局部变量就必须初始化了,否则编译会报错 这正是java的特点,极大的提高了代码安全性 在java中,定义的 阅读全文
posted @ 2021-03-08 17:17
谷先生
阅读(238)
评论(0)
推荐(0)
摘要:
public static void main(String[] args) { try { Properties p =new Properties(); p.load(Thread.currentThread().getContextClassLoader().getResourceAsStre 阅读全文
posted @ 2021-03-06 15:50
谷先生
阅读(174)
评论(0)
推荐(0)
摘要:
public class druid { public static void main(String[] args) { Map<String, String> map = new HashMap<>(); map.put("url","jdbc:mysql:/db1"); map.put("us 阅读全文
posted @ 2021-03-03 21:31
谷先生
阅读(294)
评论(0)
推荐(0)
摘要:
public class dbutilstext { public static void main(String[] args) { try { Connection c =DriverManager.getConnection("jdbc:mysql:/db1?user=aa"); // Sys 阅读全文
posted @ 2021-03-03 20:01
谷先生
阅读(87)
评论(0)
推荐(0)
摘要:
1 阅读全文
posted @ 2021-03-02 21:59
谷先生
阅读(42)
评论(0)
推荐(0)
浙公网安备 33010602011771号