定义一个平面中的Circle类:
来源:互联网 发布:win10 php安装环境 编辑:程序博客网 时间:2024/06/08 08:25
package text3;public class Circle {int x;int y;int r;Circle(){//无参的构造方法x=1;y=1;r=1;System.out.println("圆c1的圆心为:"+"("+x+","+y+")"+"半径为"+r);}Circle(int xx,int yy,int rr){//有参的构造方法x=xx;y=yy;r=rr;System.out.println("圆c2的圆心为:"+"("+x+","+y+")"+"半径为"+r);}void circleSame(Circle c) {if(x==c.x&&y==c.y&&r==c.r)System.out.println("两个圆重叠");elseSystem.out.println("两个圆不重叠");}}package text3;import java.util.Scanner;public class text3 {public static void main(String[] args) { Scanner sc=new Scanner(System.in); int xx=sc.nextInt(); //输入圆的圆心坐标和半径 int yy=sc.nextInt(); int rr=sc.nextInt(); Circle c1=new Circle(); //用Circle类创建对象c1 Circle c2=new Circle(xx,yy,rr); //创建对象c2 c1.circleSame(c2); //对象c1调用circleSame方法}}
阅读全文
0 0
- 定义一个平面中的Circle类
- 定义一个平面中的Circle类:
- 定义一个平面中的circle类
- 定义一个平面中的Circle类
- 定义一个平面Circle 类
- 课堂练习3: 定义一个平面中的Circle类
- 课堂练习3: 定义一个平面中的Circle类
- 以Point类为基础,定义一个平面中的Circle类
- 以Point类为基础,定义一个平面中的Circle类
- lesson 2:作业3:以Point类为基础,定义一个平面中的Circle类:
- 以Point类为基础,定义一个平面中的Circle类:
- 课堂练习3: 以Point类为基础,定义一个平面中的Circle类:
- 以Point类为基础,定义一个平面中的Circle类:
- 以Point类为基础,定义一个平面中的Circle类
- 以Point类为基础,定义一个平面中的Circle类:
- 以Point类为基础,定义一个平面中的Circle类
- 定义一个圆类(Circle),
- 定义一个圆类(Circle)
- parseRequest(RequestContext)还是parseRequest(HttpServletRequest)
- 基于iData平台的数字城市整理建库方法
- windows + Linux禅道环境搭建
- Android 相机拍照后 ,Intent 返回 null问题 的 l对应方法
- Ubuntu16.04 Nginx配置HTTPS
- 定义一个平面中的Circle类:
- JS总结-----JavaScript对象
- hive 变量替换
- java开发WEB应用需要的基础知识
- 可重入函数与不可重入函数
- android学习---使用OkHttp
- Python 命名规范
- ES6--数据结构Set
- Java异常处理-throws关键字