All pastes #715525 Raw Edit

Ationin

public text v1 · immutable
#715525 ·published 2007-09-26 11:36 UTC
rendered paste body
public class T17 {
	public class Radio {
		private boolean turnedon;
		private double channel;
		private int volume;

		//CONSTRUCTOR
		public Radio() {
			this.turnedon = false;
			this.channel = 10000;
			this.volume = 4;
		}

		//ACCESSORS
		public void turnedon() {
			this.turnedon = !turnedon;
			System.out.println(this.turnedon);
		}

		public void volume(int vol) {
			if (vol >= 0 && vol <= 9) this.volume = vol;
			System.out.println(this.volume);
		}

		public void channel(double chan) {
			if (chan >= 0 && chan <= 0) this.channel = chan;
			System.out.println(this.channel);
		}
	}
	
	//MAIN STARTS
	public static void main(String[] args) {
		Radio reidio = new Radio();        //<-------------------THIS ONE BUGS "T17.java:32: non-static variable this cannot be referenced from a static context"
	}
}