-2
I’m doing a job that consists of fictitious real estate. In this program there is a class called principal where it receives Immovel (Class) and stores the immovables in a vector, a class Immobiliary that has ways of registering the immovables, a superclass Immovel and other 4 classes that are the types of Immovel (Land, Salacomercial, House and Apartment) each of these 4 classes has a @override of Imovel to display its attributes. it follows how I realized the storage of the immovables:
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 immovable registration function and the Main class the function of storing in the array. Where and how I call a function to search in the array a specific immovable (ex by the existing owner attribute in all immobles) and call its respective function displaDetails(); existing in each immovable instance?
Any additional information may be requested ;)