001package headfirst.command.party; 002 003public class TV { 004 String location; 005 int channel; 006 007 public TV(String location) { 008 this.location = location; 009 } 010 011 public void on() { 012 System.out.println(location + " TV is on"); 013 } 014 015 public void off() { 016 System.out.println(location + " TV is off"); 017 } 018 019 public void setInputChannel() { 020 this.channel = 3; 021 System.out.println(location + " TV channel is set for DVD"); 022 } 023}