zoukankan      html  css  js  c++  java
  • Java 学习笔记及资源

    Spring框架入门HelloWorld :http://www.importnew.com/13246.html  (iteye 唐 博客,跟我学Sprint)

    Spring 框架下载地址:http://repo.spring.io/release/org/springframework/spring/

    Class.forName方法,此方法含义是:加载参数指定的类,并且初始化它。

            // TODO Auto-generated method stub
            //声明connection 对象
            Connection con;
            //驱动程序名
            String driver = "com.mysql.jdbc.Driver";
            //URL指向要访问的数据库名
            String url  = "jdbc:mysql://localhost:3306/sqltestdb";
            String user = "root";
            String password = "123456";
            try {
                //加载驱动程序
                Class.forName((driver));
                //1 .getConnection()方法连接MYSQL数据库;
                con = DriverManager.getConnection(url,user,password);

    抽象类:抽象类不能实例化对象,类的其它功能仍然存在。抽象类只能被继承,才能被使用。在java中使用abstract 业定义抽象类;

    /* 文件名 : Employee.java */
    public abstract class Employee
    {
       private String name;
       private String address;
       private int number;
       public Employee(String name, String address, int number)
       {
          System.out.println("Constructing an Employee");
          this.name = name;
          this.address = address;
          this.number = number;
       }
       public double computePay()
       {
         System.out.println("Inside Employee computePay");
         return 0.0;
       }
       public void mailCheck()
       {
          System.out.println("Mailing a check to " + this.name
           + " " + this.address);
       }
    }
    

      

  • 相关阅读:
    你最该知道的事(职场)
    C++ OTL MySQL(Windows/Linux) V8.1
    mysql字符串替换
    NYOJ 17 单调递增最长子序列
    IOS Sqlite用户界面增删改查案例
    时间戳工具类
    2014年7月10日,我人生的最重要Upgrade
    Java线程演示样例
    hiho模拟面试题2 补提交卡 (贪心,枚举)
    Android.mk添加本地程序和库的经常使用模版
  • 原文地址:https://www.cnblogs.com/lrzy/p/8267161.html
Copyright © 2011-2022 走看看