www.wdby.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 =...

//填好了,自己看吧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...

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...

package com.zzb.test; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Test { public boolean isNum(int c) { return 48 = c; } //通过比较ASCII码判断是否符合要求 public boolean test(String s) { char[] s...

第一题: public class People{private String name;public String speak(){return "";}public String getName(){return name;}public void setName(String name){this.name = name;}}public class American extends People{private String name...

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 ...

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...

网站地图

All rights reserved Powered by www.wdby.net

copyright ©right 2010-2021。
www.wdby.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com