Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1. /**
  2.  *
  3.  * @author Dalen Jones
  4.  *
  5.  */
  6. public class Computer {
  7.     private String brand;
  8.     private double ghz;
  9.     /**
  10.      * Constructs the computer class
  11.      * @param theBrand the brand
  12.      * @param theGhz the gigahertz
  13.      */
  14.     public Computer(String theBrand, double theGhz) {
  15.         brand = theBrand;
  16.         ghz = theGhz;
  17.     }
  18.     /**
  19.      * Gets the brand
  20.      * @return brand the brand
  21.      */
  22.     public String getBrand() {
  23.         return brand;
  24.     }
  25.     /**
  26.      * Gets the gigahertz
  27.      * @return ghz the gigahertz
  28.      */
  29.     public double getGhz() {
  30.         return ghz;
  31.     }
  32.     /**
  33.      * Gets a string representation of the object
  34.      * @return a string representation of the object
  35.      */
  36.     public String toString()
  37.     {
  38.         String s = getClass().getName()
  39.                 + "[brand=" + brand
  40.                 + ",gigahertz=" + ghz
  41.                 + "]";
  42.         return s;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement