SHARE
TWEET

Untitled

a guest Apr 21st, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package MobilePhone;
  2.  
  3. public class Battery {
  4.  
  5.     private String model;
  6.  
  7.     private double idleTime;
  8.  
  9.     private double hoursTalk;
  10.  
  11.  
  12.     public Battery(String model, double idleTime, double hoursTalk) {
  13.         this.model = model;
  14.         this.idleTime = idleTime;
  15.         this.hoursTalk = hoursTalk;
  16.     }
  17.  
  18.     @Override
  19.     public String toString() {
  20.         return String.format("Model: %s\n" +
  21.                 "Idle time: %.2f\n" +
  22.                 "Hours talk %.2f\n",this.model,this.idleTime,this.hoursTalk);
  23.     }
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top