Advertisement
advictoriam

Untitled

Mar 5th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. /**
  2.    Represents a light bulb of some type.
  3. */
  4. public abstract class LightBulb
  5. {
  6.    private double lumens;
  7.    
  8.    public LightBulb(double _lumens)
  9.    {
  10.       lumens = _lumens;
  11.    }
  12.    
  13.    public abstract String getShape();
  14.    
  15.    /**
  16.       Gets a description of this light bulb.
  17.       @return a string of the form lumensPerWatt=...,shape=... (without any spaces)
  18.    */
  19.    public String getDescription()
  20.    {
  21.       return String.format("lumensPerWatt=%s,shape=%s", lumens, getShape());
  22.    }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement