April 2019
Intermediate to advanced
360 pages
9h 17m
English
The PrinterOffLine class extends the PrinterController class and overrides the pushPrint() method. When called, this method powers the printer on. The printer goes from being offline to online:
public class PrinterOffLine extends PrinterController { @Override public void pushPrint(Printer printJob) { System.out.println("\nPowering printer on please wait. . ."); printJob.setPrinterState(new PrinterOnLine()); }}
As you can see in the preceding code, the pushPrint() method in the PrinterOffLine class results in the printer going from offline to online.
Read now
Unlock full access