Aaron Shawlington wrote:
windy col wrote:Can anyone also suggest a book for someone brand new trying to learn Java? I need beginners level with really no knowledge of Java. I have gone to the suggested links and will also check out Cave of Programming. I tried using Eclipse and found NetBeans easier and BlueJ I tried as well from a course I am watching on Udacity.com. I really don't care for BlueJ. The more sites I go to I seem to end up more confused
I tried to put this into NetBeans and kept getting error messages. This was from http://javatutorialhq.com/java/program-structure/ (It didn't really copy and paste correctly)
class DeskFan {
boolean powerOn = false;
int currentGearSpeed=3;
boolean isOscillating=true;
void turnOn(boolean newVal){
powerOn = newVal; }
void changeGearSpeed(int newVal){
currentGearSpeed = newVal; }
void changeOscillation(boolean newVal){
isOscillating=newVal; }}
Thanks,
Windy
Looks like a rubbish tutorial (followed the link). The example is incomplete - there is no showState() method on the DeskFan class.