Can we create an object of private class?



Can we create an object of private class?..

Answer / Anju Upadhyay

No, a class with a private access modifier can only be accessed within the same file. Therefore, it cannot be instantiated as an object from another file.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can you call a constructor within a constructor?

7 Answers  


How do you replace a string in java?

1 Answers  


Explain the private protected method modifier?

1 Answers  


Differences between C and Java?

1 Answers   TCS,


what is difference between Interface and abstract class

2 Answers   GCPL,


What is use of valueof () in java?

1 Answers  


Explain creating threads by implementing runnable class?

1 Answers  


Can we override static methods in java?

1 Answers  


How to do a true java ping from windows?

1 Answers  


How many bits is a word?

1 Answers  


How do you convert string to int in java?

1 Answers  


Is it safe for adding 10,00,000 records/objects to HashMap?, i.e is it safe to add millions of objects to HashMap?

2 Answers  


Categories