can we declare private class in java file?

Answer Posted / honey

main class can not be make private in java ,only the nested class can be make privateand it can be assessable only in the main class not access by any other class in the package.

Is This Answer Correct ?    13 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible to use string in the switch case?

545


What is meant by object oriented programming – oop?

535


What is class and its types?

530


How do you create a bulleted list?

554


What do you meant by active and passive objects?

599






What is rmi and steps involved in developing an rmi object?

559


What happens if a constructor is declared private?

520


What data type is a string?

505


What are methods and how are they defined?

599


How is java created?

527


When arithmeticexception is thrown?

571


What is array initialization in java?

484


What kind of variables a class can consist of?

626


What does microservices mean?

522


Where and how can you use a private constructor?

527