I am attempting to get one class to return a string from another class, though the return I get is null. I have a set method that works in setting the string in the original cla
Flavour is not initialized private String flavour; as anything, when calling IceCream() you set String flavour = getFlavour(), which sets the local variable flavour inside the constructor to null, because getFlavour() returns null. Also the local String flavour variable inside the constructor overshadows the String flavour field of your IceCream class. Try making flavour a parameter of the constructor and then setting the field to that string
public IceCream(String f) {
this.flavour = f;
price = 0.50;
}
or call setFlavour() before you work with the object you created.