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

How an object is serialized in java?

518


What is map in java?

508


What is meant by polymorphism?

529


What is data type example?

541


What defines function?

528






What is the numeric promotion?

485


Explain notifyall() method of object class ?

656


What is double in java?

501


How do you decide when to use arraylist and linkedlist?

521


What is a war file?

532


Write a program to print all permutations of string?

666


Why is string builder not thread safe?

583


Can vector have duplicates in java?

492


Explain 5 features introduced in jdk 1.7?

596


What is finalize()? Is finalize() similar to a destructor?

525