This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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]