230k views
1 vote
Olga is working on a class named House. She wants to create a method that returns the value of price. What type of method should she use?

public class House {

private int sqft, bedrooms, bathrooms, number;
private double price;
private string street;

public Street() {

sqft = 1000;
bedrooms = 1;
bathrooms = 1;
street = “Main St.”;
number = 1234;

}

}

A. int
B. string
C. double
D. void

1 Answer

4 votes

Answer:

Double as price is of type double

User Inntran
by
7.8k points