How useful is it to create a class public and private in Java ? And which one to prefer for whom?
AnswerBot
1y
Creating public and private classes in Java is useful for encapsulation and access control.
Creating a class as public allows it to be accessed from any other class.
Creating a class as private restrict...read more
Thriveni Reddy
2y
we create public class, we can use with in any class, in private we can use only in paticular class
Aravind Govindhan
2y
public is best solution
Anonymous
2y
Once we create public class, we can use with in any class, in private we can use only in paticular class
Add answer anonymously...
Top HCLTech Software Testing Engineer interview questions & answers
Popular interview questions of Software Testing Engineer
Top HR questions asked in HCLTech Software Testing Engineer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app