can we declare private class in java file?

Answer Posted / veerendra

yes,we can declare if it is inner most class, but outer
class is not allowed because java supports inheritance
concept for reusing the properties from super class to sub
class,at that time the super class is private it wont access
inside,only public features we can reuse it, we can access
and execute through out the world, not private with in the
class onle we can access it.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you declare the main method as final?

725


What is a list in java?

720


How can we achieve thread safety in java?

903


What is the basic of java?

784


What are the advantages of encapsulation in java?

749


What is null mean in java?

849


What is %d in printf?

750


Which is faster string or stringbuilder?

709


What does opcode mean?

772


What are the advantages of user defined functions?

751


What are parsing rules?

725


How do you remove an object from an arraylist in java?

667


Can variables be used in java without initialization?

793


What are different types of references?

752


What is the difference between JDK and JVM?

866