By not defining an access level the class receives default access, which means that it is accessible by classes in the same package. Since you did not have any package declarations for either class they are both in the default package. Since they are in the same package TestCanvas can access MyCanvas.
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
Joined: Jul 01, 2009
if i shift MyCanvas class to other .java file
[that file will contain only MyCanvas class]