class getsum
//定義方法 i 求a+b -返回--> 結果(返回值)
public static int getsum(int x,int y)
//定義方法 ii
public static void sop(string x)
public static int sop(int x)
// 1,引數列表 2,返回值型別 string
public static string introduce(string name,int age)
/*1, 多個方法的名字 必須一模一樣
2, 引數列表不一樣
1,引數的個數
2, 引數的型別
3, 和返回值型別( 以及訪問修飾符 )無關
*/public static int getinfo(int x)
public static void getinfo()
public static void sum (int num)
}system.out.println(num1); }
// 5*4*3*2*1
public static int getsum(int x)
return x*getsum(x-1); }
class getsum
// zy
public static void num1(int number)else if(b%3==0)else if(b%5==0)else if(b%7==0)else if(b%13==0)else if(b%11==0)else
} }}
//gn
public static void table()
system.out.println();
} }
public static int sum(int num)else
}class getsum
public static int show1(int x)
public static int show2()
public static int sum (int num)
return num+sum(num+1);
}}class getsum
// zy
public static void num1(int number)else if(b%3==0)else if(b%5==0)else if(b%7==0)else if(b%13==0)else if(b%11==0)else
} }}
//gn
public static void table()
system.out.println();
} }
Java學習9 多型
實物存在的多種體現形態。父類的引用指向了自己的子類物件,即父類的引用也可以接收自己的子類物件。必須是類與類之間有關係,要麼繼承,要麼實現 通常還有乙個前提 存在覆蓋。提高了程式的擴充套件性。只能使用父類的應用訪問父類中的成員。吃魚捉老鼠 吃骨頭 abstract class animal class...
學習筆記9
函式 函式以def開頭,後面接函式名和括號,然後接冒號 函式的最後接return結束函式,並返回乙個值,可以沒有,就相當於返回none 函式呼叫時直接用函式名加括號 括號內為需要傳入的引數。傳入函式的引數是實參 在函式內使用的大多都為形參 形參只能在函式內使用,函式結束後就自動釋放記憶體了。函式中的...
學習筆記9
今天來進行系統的學習一下css 層疊樣式表 首先說一下層疊次序,四個優先權 1.瀏覽器預設設定 2.外部樣式表 3內部樣式表 位於 內部樣式表 內聯樣式 this is a paragraph 多重樣式 例 h1居中對齊 h1 h1 css的使用 背景 background color backgr...