/* * @topic T00965 Using "this" reference to pass object to a method * @brief Product class, its constructors, and print( ) method */ package objectdemo; public class Product { // the instance variables private String code; private String description; private double price; //constructors public Product() { // Invokes another constructor: this( "unknown", "unknown", 0.0 ); } public Product(String code, String description, double price) { this.code = code; this.description = description; this.price = price; } // operations public String getDescription() { return description; } public void print() { LaserPrinter lz = new LaserPrinter( "//localhost" ); lz.print( this ); } }//class Product