Please help with a do--while loop
I am very new to java so please excuse me for asking noob questions!
I am trying to create a do--while loop in my program which repeats itself upon user input of y or Y. Here is the code. All help is much appreciated!
public class myBook
public static void main (String args)
String another = "y", title, author, publisher;
Scanner scan = new Scanner (System.in);
System.out.print("Enter book info:\nTitle:");
title = scan.nextLine();
author = scan.nextLine();
publisher = scan.nextLine();
year = scan.nextInt();
Book book1 = new Book(title, author, publisher, year);
System.out.print ("Enter another book (y/n)? ");
another = scan.nextLine();