摘要:
public class Digui1 { int sum=0; int a=2; public void sum() { sum+=a; a++; if(a<=100) { sum();//调用自身实现递归 } } public static void main(String[] args) { 阅读全文
摘要:
public class Digui{ public static void main(String args[]){ System.out.println("计算结果:"+ sum(100)) ; //调用操作 } public static int sum(int num){ //定义方法用于求 阅读全文
摘要:
public class 逆序 { public static void main(String[] args) { // TODO 自动生成的方法存根 int[] grade = {15,12,9,6,3}; int m; for(int i = 0; i < 2; i++){ m = grade 阅读全文
摘要:
package org.OverWrite;class Person{ private String name; private int age; public void setName(String name){ this.name=name; } public void setAge(int a 阅读全文
摘要:
class Box{ double width; double depth; double height; Box(){ width=0;height=0;depth=0; } Box(double w,double h,double d){ width=w;depth=d;height = h; 阅读全文
摘要:
class SuperClass{ private int n; SuperClass(){ System.out.println("SuperClass()"); } SuperClass(int n){ System.out.println("SuperClass("+n+")"); this. 阅读全文
摘要:
class Person{ public String name; Person(String name){ this.name=name; }}class Student extends Person{ public int studentId; Student(String str,int id 阅读全文
摘要:
package org.OverWrite;class Person{ private String name; private int age; public void setName(String name){ this.name=name; } public void setAge(int a 阅读全文