Q:

how to get back to loop after this if?

would you please help me on this?
I have written an class  and here is the code. I have two problems. 
(1) I wanted to know how to get back to the beginning of the loop after user has enter copies he wants to add instead of exiting the system. I mean after system says "copies has been added." it ask user "if you want to add a book?" and then loop start again.
(2) What should I do to add an object to the array each time loop is finished?
my problem is everytime loop is running, the book1 is being rewritten. 
 thank guys- solved

A:

As discussed, this will make your loop run until the user enters yes
System.out.println("do you want to add a Book?(yes or no) ");
Scanner s=new Scanner(System.in);
String h = s.nextLine();
while (h.contains("yes")|| h.compareToIgnoreCase("YES") == 0) {
int size=list.size();
//your code here
System.out.println("do you want to add a Book?(yes or no) ");
h = s.nextLine();
} 

