What is the difference between declaring a method public versus leaving it blank (default)?
void eat() {
System.out.println("This food is great");
}
public void eat() {
System.out.println("This food is great");
}
public - anyone, everywhere
default(no modifiers) - only in package and in this class
Otherwise, default - you can call this method only from this class( inside calls) and from another package