Why non nested classes in java are not having marked as
protected access specifier

Answer Posted / yayati pavan

When the non nested class declared as public or
default(public) the jvm can access the class and execute.
So non nested class must always public. other wise jvm can't
access the class.

Is This Answer Correct ?    7 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is collections framework?

831


What are the kinds of polymorphism?

819


Why java is made?

749


What is the difference between method overriding and overloading?

798


What is multi-catch block in java?

812


Is zero a positive integer?

761


Does A Class Inherit The Constructors Of Its Superclass?

736


Why can't we make a class private in java?

766


How do you declare an array in java?

738


How to remove the trailing spaces from a string?

877


Does java runtime require a license?

766


Can I use % with real numbers?

744


How to convert string to byte array and vice versa?

775


What is used of static keyword in java?

762


What is the difference between sop and work instruction?

679