Current location - Training Enrollment Network - Books and materials - Create a book object
Create a book object
Import java.util.scanner;

Public class MyClass {

Public static void main (strinargs []) {

String author, book _ name

Floating price;

Scanner sc = new scanner (system. in); //This thing sc is arbitrary, instantiating the object, (just for SC. * * at the back)

System.out.println ("Enter the author (press enter to confirm):");

author = sc . next(); //Assign the value to the author from the keyboard

System.out.println ("Enter the title of the book (press enter to confirm):");

book _ name = sc . next();

System.out.println ("Enter the price (press enter to confirm):");

price = sc . next float();

system . out . println(" Author:"+Author+" \ n title:"+book _ name+" \ n price:"+price);

}

}