In below code i'm doing somthing wrong. Sorry if this is a bit basic. I get this working fine if it's all in the one class but not when i break the classes up like in the code below:
class Apples{
public static void main(String[] args){
String bucket = "green"; //instance variable
Apples appleOne = new Apples(); //create new object (appleOne) from Apples class
System.out.println("Paint apple one: " + appleOne.paint(bucket));
System.out.print("bucket still filled with:" + bucket);
}//end main
}//end class
class ApplesTestDrive{
public String paint(String bucket){
bucket = "blue"; //local variable
return bucket;
}//end method
}//end class
Error Message:
location:class Apples
cannot find symbol
pointing to >> appleOne.paint(bucket)
Any hints?