nynw.net
当前位置:首页 >> JAvA问题 为一个CriClE类添加一个方法,计算一个点... >>

JAvA问题 为一个CriClE类添加一个方法,计算一个点...

刚刚写的,本机测试通过:import java.awt.Point;public class Cricle { // 圆点 private Point cricleCenter = null; // 半径 private double radius = 0; public Cricle(Point cricleCenter, double radius) { this.cricleCenter = cricleCent...

Java程序: import java.awt.Point;public class Test {public static void main(String[] args) {Circle c = new Circle(new Point(0, 0), 2);Point p = new Point(1, 1);if(c.isInner(p)) {System.out.println("坐标点p在圆内");}else {System...

import java.util.Scanner; class Point{ private double x; private double y; public double getX() { return x; } public void setX(double x) { this.x = x; } public double getY() { return y; } public void setY(double y) { this.y = y...

import java.awt.Point; public class Circle{ private Point centerPoint; private int r; public Circle(){} public Circle(Point p,int r){ this.r=r; this.centerPoint=p; } public int getR(){return this.r;} public void setR(int r){thi...

//圆心坐标在此题中无用,是否是需求有问题。public class Circle { double x; double y; double r; double area; double length; public static void main(String[] args) { Circle c = new Circle(); c.setR(2); c.getArea(); c.getLength(); ...

package circle; public class Easy { private double Bj; private static double Pi=3.1415; public double getBj() { return Bj; } public void setBj(double bj) { Bj = bj; } public double getPi() { return Pi; } public static double zh...

import java.lang.*;public class Circle { private int radius; // 圆半径 private double area; // 圆面积 final double PI = 3.1415926; // 圆周率 // 带参构造函数 public Circle(int r){ radius = r; } // 无参构造函数 public Circle(){ ...

public class CircleClass { double x0,x1,y0,y1; //test public static void main(String[] args) { CircleClass circle = new CircleClass(0,0,8.5,9); circle.cal(); CircleClass circle2 = new CircleClass(2,3.5,9,6); circle2.cal(); } //...

class Circle2D{ double x=0,y=0,radius=1; public double getX(){ return x; } public double getY(){ return y; } public double getRadius(){ return radius; } Circle2D(){ } Circle2D(double x,double y,double radius){ this.x=x; this.y=...

public class Circle { double radius; public Circle(double rad) { radius = rad; } public double calcArea() { return Math.PI * radius * radius; } public static void main(String[] args) { Circle c = new Circle(3); System.out.print...

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