Java-Fehler: Konstruktor in Klasse kann nicht auf bestimmte Typen angewendet werden

Ich habe gerade den Konstruktor Building hinzugefügt und dachte, alles würde gut funktionieren, aber in Zeile 43 wird eine Fehlermeldung angezeigt. Beim Erstellen des ObjektsBuilding b = new Building();Es heißt, ich brauche einedouble undint In dem Argument habe ich also getan, was gesagt wurde, aber ich bekomme immer mehr Fehler. Was mache ich falsch?

//This program lets the user design the area and stories of a building multiple times
//Author: Noah Davidson
//Date: February 20, 2014

import java.util.*;

public class Building//class begins
{
static Scanner console = new Scanner(System.in);

double area;//attributes of building
int floors;

public Building (double squarefootage, int stories)
{
area = squarefootage;
floors = stories;
}

void get_squarefootage()//user enters the area of floor
{
System.out.println ("Please enter the square footage of the floor.");
area = console.nextDouble();
}

void get_stories()//user enters the amount of floors in the building
{
System.out.println ("Please enter the number of floors in the building.");
floors = console.nextInt();
}

void get_info()//function prints outs the vaibles of the building
{
System.out.println ("The area is: " + area + " feet squared");
System.out.println ("The number of stroies in the building: " + floors + " levels");
}

public static void main(String[] args)//main starts
{
char ans;// allows for char 

  do{ // do/while loop starts so user can reiterate the program as many times as they desire
   Building b = new Building();//creates the object b
   b.get_squarefootage();//calls the user to enter the area
   b.get_stories();//calls the user to enter the floors
   System.out.println ("---------------");
   b.get_info();// displays the variables
   System.out.println ("Would you like to repeat this program? (Y/N)");
   ans = console.next().charAt(0);// user enters either Y or y until they wish to exit the program
   }while(ans == 'Y'||ans == 'y');// test of do/while loop
}
}

Antworten auf die Frage(2)

Ihre Antwort auf die Frage