Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * @author Dalen Jones
- *
- */
- public class Computer {
- private String brand;
- private double ghz;
- /**
- * Constructs the computer class
- * @param theBrand the brand
- * @param theGhz the gigahertz
- */
- public Computer(String theBrand, double theGhz) {
- brand = theBrand;
- ghz = theGhz;
- }
- /**
- * Gets the brand
- * @return brand the brand
- */
- public String getBrand() {
- return brand;
- }
- /**
- * Gets the gigahertz
- * @return ghz the gigahertz
- */
- public double getGhz() {
- return ghz;
- }
- /**
- * Gets a string representation of the object
- * @return a string representation of the object
- */
- public String toString()
- {
- String s = getClass().getName()
- + "[brand=" + brand
- + ",gigahertz=" + ghz
- + "]";
- return s;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement