I know this is a pretty silly question, but what is exactly an object instance variable? To explain what I mean, take two classes:-
public class Duck {
boolean hasAtail;
double height;
public void go() {
System.out.println(hasAtail + " " + height);
}
}
public class DuckTestDrive {
public static void main(String[] args {
Duck d = new Duck();
d.hasAtail = false;
d.height = 23.0;
d.go();
}
}
That will perfectly compile, but how do I make the main method for this?
public class WhatEver {
Duck m;
public void GO() {
m.go();
}
}