A method that could return a Child Object from a Parent Array?

im looking for a method that could retun a Child Object from a Parent Array

This was my try

class Store{

private BookParents store[];

private int ind, max;

public store() {



store =new BookParents[100];


public BooksParents SearchBook(String c) {

BookChild null1 = new Book1("Unknown", 0,



for(int i=0 ;i
if(c.compareTo(store[i].getName(store[i]) )==0)


return store[i];


System.out.println("Book didn't find, try another name.");

return null1;


else {

System.out.println("There is not books in the store");

return null1;}



Read More »

By: StackOverFlow - Monday, 5 November

Related Posts