I have noticed that if don\'t write public before a class its works same as like a public class. I can\'t understand why so? It should show a error
No a normal class and a public class don't work the same .A class without a access modifier such as public is automatically set to default access.(No, you can't give default as access explicitly). If you create a default access class inside a package then that class cannot be accessed outside that package but public class can be accessed even outside that package