As stated in many places, a class yields a package-private access level, which means such a class can only be accessed by others is the same package. I don't know many things about packages, but I suppose knowing you add "package x" at the start of a file is enough knowledge to pose my question.
I've made a file with a class ingredient. Another file contains
public class cooking{ public static void main(String[] args) {..... There's no package declaration anywhere. Still, my program compiles the two files successfully, and also runs so. What am I missing? Shouldn't the cooking class NOT be able to see ingredient?
packagestatements for both classes.