I'm doing a job that consists of a fictional real estate. In this program there is a class called principal where it receives Property (Class) and stores the real estate in a vector, a real estate class that has method of registering the real estate, a superclass Real estate and other 4 classes that are the types of Property (Land, House and Apartment) each of these 4 classes has an @override of Property to display its attributes. Here's how I accomplished the storage of real estate:
Imovel[] imoveis; // cria vetor de imoveis do tipo Imovel (SuperClasse)
//Pega o imovel e coloca no dito array
public void setImovelArray(Imovel imv) {
imoveis[b] = imv;
b++;
System.out.println("Imóvel guardado sob ID:"+b);
}
Logic party where the real estate class has the function register real estate and the main class the function of storing in the array. Where and how do I call a function to search the array for a specific property (eg for the owner attribute in all properties) and call its respective function ViewDetails (); existing in each instance of property?
Any additional information you may request;)