why is public class is written in bluej
Answers
Answered by
1
A class describes its behaviour through its methods, where a method is a place where the logic of a class is stored.
abhishekpandey77:
kiuki suprit is bewkuf
Answered by
1
What are access specifiers ?
Answer :
Access specifiers are the key words that specify the accessibility of datamembers , variables , objects , methods and others .
There are three access specifiers :
(i) public .
(ii) private .
(iii) protected .
Why is public class written ?
Answer :
Public is an access specifier as explained above.
Thus the keyword is attached with class when we want to access the class from any class.
When we do not want the class to be hidden or strengthen its privacy , we specify the keyword as public.
Public class allows any user to access the class from any other class .
This is useful in certain cases and hence the public keyword is applied in certain cases.
Hope it helps !
________________________________________________________________________
Similar questions