java中找不到合适的构造器,找不到适合的构造函数

I am having issues with getting the TestPolygon.java to run correctly. THe "//Constructor that creates four polygons with any value that are not equal to the defualt value or to each other Polygon[] P_array = {new Polygon(10,5.0,1.0,3.0), new Polygon(6,3,2,5), new Polygon(4,11,4,3), new Polygon(5,12,6,7)}; " line of my code keeps coming back with an error for every new statement saying that "no suitable constructor found for Polygon(int,double,double,double). Picture is attached.

/* File: Polygon.java

* Author: Darren Pirtle Jr.

* Date: November 16, 2016

* Purpose: Design a Java class

* named Polygon

*/

import java.lang.Math;

public class Polygon {

private int numSides;

private double sideLength;

private double xCoord;

private double yCoord;

private double apothem;

private double perimeter;

//Constructor that creates a Polygon using the defaults

public Polygon(){

numSides = 4;

sideLength = 10.0;

xCoord = 0.0;

yCoord = 0.0;

apothem = 5.0;

}

//Constructor that uses the specified numbers

public Polygon(int s,double sL,double x,double y,double a, double p){ </

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值