摘要:
泛型(Generic type 或者generics)是对 Java 语言的类型系统的一种扩展,以支持创建可以按类型进行参数化的类。可以把类型参数看作是使用参数化类型时指定的类型的一个占位符,就像方法的形式参数是运行时传递的值的占位符一样。 在定义类或者接口的时候可以为类和接口指定类型形参,在定义变 阅读全文
摘要:
package lianxi; public class Yuan { public static void main(String[] args) { double r=3.0; double circle=2*r*Math.PI; double area=Math.PI*r*r; System. 阅读全文
摘要:
package b; import java.util.Scanner; public class Zifuchuan { public static void main(String[] args) { System.out.println("输入字符串:"); Scanner zifu=new Scanner(System.in); ... 阅读全文
摘要:
package b; public class Rect { Double width; Double height; public Double getWidth() { return width; } public void setWidth(Double width) { this.width 阅读全文
摘要:
package b; public class Car { public final static Car pinpai=new Car(); public static Car instance() { return pinpai; } public void drive() { System.o 阅读全文
摘要:
package b; public class Person { private String name; private String address; private String telephone; private String email; public String getName() 阅读全文
摘要:
package zimu; public class A { public void f() { for (int i = 97; i <123; i++) { System.out.print((char)i); } System.out.println(); } } package zimu; 阅读全文
摘要:
public class A { private int a=1; public int getA() { return a; } public void setA(int a) { this.a = a; } public void a() { System.out.println("a="+a) 阅读全文
摘要:
package jicheng; public class Monkey { private String s; public String getS() { return s; } public void setS(String s) { this.s = s; } public Monkey(S 阅读全文