Computer Science, asked by HYDRADYNAMO, 1 year ago

why is public class is written in bluej

Answers

Answered by monukumar1391
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
monukumar1391: A class describes its behaviour through its methods, where a method is a place where the logic of a class is stored.
HYDRADYNAMO: rong
Answered by Anonymous
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 !

________________________________________________________________________


abhishekpandey77: wow v good bro well answered
Anonymous: thanks !
Similar questions