tnfh.net
当前位置:首页 >> jAvA编程题 >>

jAvA编程题

/** * 2015年8月31日上午11:30:07 * @author cs12110 */public class WuMingFen {String theFen;// 粉的口味int quantity;// 重量boolean likeSoup;// 带汤标识public WuMingFen(String theFen, int quantity, boolean likeSoup) {this.theFen =...

public class Lingxing { public static void main(String[] args) { int i =0; int j =0; int m=0; System.out.println("打印的图形如下:"); //第一个循环控制打印的行数 for(i=1;ii;m--){ System.out.print(" "); } //下面的两个循环是为了打...

//圆类Circle import java.util.Scanner; public class Circle { private double radius; public double getRadius() { return radius; } public void setRadius(double radius) { this.radius = radius; } //无参构造函数 public Circle(){ thi...

public static void GetSum() { int sum = 0; for(int i=1;i

两个代码 一个学生类, 一个测试类 你自己把他们放不同包里面 public class Student {private int Snum;private int Gnum;private String Sname;private String Ssex;private int Sage;private static int count = 0;public Student(int snum, i...

public class Person { private int age; private boolean sex; private int weight; public Person(int age, boolean sex, int weight) { this.age = age; this.sex = sex; this.weight = weight; } public int getAge() { return age; } publi...

public abstract class Car { public abstract String getInfo(); } class BMW extends Car { @Override public String getInfo() { return "BMW"; } } class Benz extends Car { @Override public String getInfo() { return "Benz"; } }class ...

//填好了,自己看吧import java.util.*;class Complex{double x,y;Complex(){}Complex(double u,double v) { x=u;y=v; } public void set(double u,double v){ x=u;y=v; } Complex add(Complex w) { Complex c=new Complex(w.x+x,w.y+y); return...

int count; String sum[] = {'h','e','l','l','o'}; for(int i=0;i

1、Queue import java.util.LinkedList; public class Queue { LinkedList queue; public Queue() { queue = new LinkedList(); } void add(Object o) { queue.addLast(o); } Object get() { Object o = null; if (!queue.isEmpty()) { o = queu...

网站首页 | 网站地图
All rights reserved Powered by www.tnfh.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com