www.wdby.net > JAvA编程题

JAvA编程题

//圆类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...

import java.util.*;import java.io.*;class Main{ public static void main(String[] args) throws Exception{ String[] ts={"A.txt","B.txt","C.txt"}; Scanner[] ss=new Scanner[ts.length]; for(int i=0;i

Rectangle类: /** * 定义一个矩形类Rectangle,包含有长length,宽width属性、构造方法(要求写出初始化长和宽)和计算面积方法getArea()。 * 编写一个长方体Cuboid * ,继承自矩形类,具有长length、宽width、高height属性,构造方法和计算体...

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(" "); } //下面的两个循环是为了打...

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

第一题: 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...

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

import java.io.*;import java.util.ArrayList;import java.util.List;public class Employee { private int no; private String name; private String address; private double salary; public Employee(int no, String name, String address, ...

package arraylist; public class Course { private String name; private double score; public String getName() { return name; } public void setName(String name) { this.name = name; } public double getScore() { return score; } publ...

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