摘要: 阅读全文
posted @ 2021-03-02 20:32 谷先生 阅读(51) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-03-02 19:43 谷先生 阅读(91) 评论(0) 推荐(0)
摘要: public Animal(){ System.out.println("Animal..."); } 总结:属性赋值的先后顺序 ④可以执行多个 阅读全文
posted @ 2021-03-02 15:41 谷先生 阅读(178) 评论(0) 推荐(0)
摘要: public static void main(String[] args) { ths ts =new ths(); ts.setName("李四"); System.out.println(ts.getName()); ts.setAge(2); System.out.println(ts.ge 阅读全文
posted @ 2021-03-02 13:14 谷先生 阅读(58) 评论(0) 推荐(0)
摘要: /** * 封装和隐藏 */ public class fengzhuang { public static void main(String[] args) { Animal animal =new Animal(); animal.name="黑子"; // animal.age=2; anim 阅读全文
posted @ 2021-03-01 22:01 谷先生 阅读(54) 评论(0) 推荐(0)
摘要: public class PreparedStatmentDemo { public static void main(String[] args) { try { //var:定义变量 var c =new DbUtil().getConn(); PreparedStatement ps = c. 阅读全文
posted @ 2021-03-01 18:36 谷先生 阅读(202) 评论(0) 推荐(0)
摘要: 链接数据库 public static void main(String[] args) { //简约方式 try { Connection conn = DriverManager.getConnection("jdbc:mysql:/mysql?user=aa"); Statement st = 阅读全文
posted @ 2021-03-01 12:33 谷先生 阅读(234) 评论(0) 推荐(0)
摘要: 如果要是用原始表的格式查询,需要先查询在使用条件。 如果要使用自定义的方式显示查询则需要把条件包起来。 阅读全文
posted @ 2021-02-24 15:43 谷先生 阅读(46) 评论(0) 推荐(0)
摘要: 1.形参:方法定义时,声明的小括号内的参数 2.实参:方法的调用,实际传递给形参的数据 阅读全文
posted @ 2021-02-23 17:08 谷先生 阅读(138) 评论(0) 推荐(0)
摘要: 1. 2. 3.匿名对象 阅读全文
posted @ 2021-02-22 16:58 谷先生 阅读(52) 评论(0) 推荐(0)