aspose file tools*
The moose likes Beginning Java and the fly likes Difference between class and public class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Difference between class and public class" Watch "Difference between class and public class" New topic
Author

Difference between class and public class

Rajat Sarkar
Greenhorn

Joined: Sep 07, 2008
Posts: 18
class Myclass
{
}

public class Myclass
{
}

Is there any difference between the above two classes?
When other classes uses 'Myclass', will they behave in the same manner?
Ronald Schild
Ranch Hand

Joined: Jun 09, 2008
Posts: 117
There is no difference in the class itself, but the access to the class is restricted differently.

Give the forum (or google) a search on public access and default access.

edit: While you're at it, search on protected and private access too
[ September 12, 2008: Message edited by: Ronald Schild ]

Java hobbyist.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38793
    
  23
Welcome to JavaRanch. A good place to start searching is in the Java Tutorials.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between class and public class