can we declare private class in java file?

Answers were Sorted based on User's Feedback



can we declare private class in java file?..

Answer / aditya kumar

yes,from Java8 we can also declare private and protected Top level classes.....but i am not getting the reason behind this why oracle did it.So if any one has it's explanation plz tell me....

Is This Answer Correct ?    0 Yes 0 No

can we declare private class in java file?..

Answer / hanumanth

Can any one give example?

Is This Answer Correct ?    10 Yes 11 No

can we declare private class in java file?..

Answer / varsha vilas kalebag

yes we can declare private class in java file

Is This Answer Correct ?    46 Yes 131 No

Post New Answer

More Core Java Interview Questions

What are the different data types in java?

0 Answers  


What is a substitution variable?

0 Answers  


What are different types of access modifiers?

3 Answers  


List the interfaces which extends collection interface?

0 Answers  


What is data type in computer?

0 Answers  


any other way to print the text without using System.out.println() in java?

5 Answers   IBM, Infosys,


What are the restriction imposed on a static method or a static block of code?

0 Answers  


Why synchronization is important in java?

0 Answers  


What is the use of Getters and Setters method ?

4 Answers  


How to access a method that it declared as protected?

3 Answers  


Can we have static methods in an interface?

0 Answers  


what state does a thread enter when it terminates its processing? : Java thread

0 Answers  


Categories