20131028
學習了Oracle sql排序 select A,COUNT(1) NB FROM A order by nb desc;
拼SQL ?select ‘truncate table ads.‘||a.tablename||’;' FROM ALL_TABLES A;
學習了Java
如何從一個藍色帶連接按鈕,跳轉到另一個頁面。 類似于<li><a HREF="workingPlatform.do?action=toMyApplyPage">我發起的申請</a></li>
通過XML找到Controller層 再到dao層。
一維數組,二維數組 foreach使用,可變變量的傳入參數。
public static void fun(int...arg){
for(int x:arg){
System.out.print(arg);
}
System.out.println();
}
類的圖形化表示
類的名稱
類的屬性
方法
類與對象的關系
類是對象的模版,對象是類的實現。
對象的產生格式
分匹配空間 new
封裝屬性
private get/set
構造方法。無參有參。
?
作業: ?定義學生類 屬性 方法。
代碼:
package com.hdy;
class Student{
private String name;
private int age;
private float english;
private float math;
private float chinese;
public Student(){};
public Student(String n,int a,float e,float m,float c){
this.setAge(a);
this.setChinese(c);
this.setEnglish(e);
this.setMath(m);
this.setName(n);
};
public float sum(){
return english+math+chinese;
}
public float avg(){
return this.sum()/3;
}
public float max(){
float max=english>math?english:math;
max=max>chinese?max:chinese;
return max;
}
public String info(){
return "姓名:"+this.getName();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public float getEnglish() {
return english;
}
public void setEnglish(float english) {
this.english = english;
}
public float getMath() {
return math;
}
public void setMath(float math) {
this.math = math;
}
public float getChinese() {
return chinese;
}
public void setChinese(float chinese) {
this.chinese = chinese;
}
}
public class Studenttest {
public static void main(String args){
Student stu =new Student("臧三",12,90.0f,11.0f,43.0f);
System.out.print("總和為" + stu.sum());
System.out.print(stu.info());
}
}
轉載于:https://www.cnblogs.com/huodongyang/p/3392940.html
總結
- 上一篇: iOS培训章节——C++函数的重载
- 下一篇: 共享文件夹Access-Based En