Facebook
From Paweł, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 208
  1. package reader;
  2.  
  3.  
  4. public class Ebook {
  5.     private int pages;
  6.     private int currPage;
  7.     Ebook(){}
  8.     Ebook(int pages, int currPage)
  9.     {
  10.         this.pages = pages;
  11.         this.currPage = currPage;
  12.     }
  13.     void setPage(int page)
  14.     {
  15.         currPage=page;
  16.     }
  17.     void previousPage(int page){
  18.         currPage=page--;
  19.     }
  20.     void nextPage(int page){
  21.         currPage=page++;
  22.     }
  23.     int getCurrP(){
  24.         return currPage;
  25.     }
  26. }
  27.