Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package exam1retake;
  7.  
  8. import javax.swing.JOptionPane;
  9.  
  10. /**
  11.  *
  12.  * @author localstudent
  13.  */
  14. public class BookTest {
  15.     static private String title;
  16.     static private String author;
  17.     static private int pages;
  18.    
  19.     public static void main(String[] args) {
  20.         title = JOptionPane.showInputDialog(null, "Title:");
  21.         author = JOptionPane.showInputDialog(null, "Author:");
  22.         pages = Integer.parseInt(JOptionPane.showInputDialog(null, "Pages:"));
  23.        
  24.         Book bookCopy = new Book(title, author, pages);
  25.        
  26.         System.out.println(bookCopy.toString());
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement