In Java,data member and member function by default take which access specifier. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

In Java,data member and member function by default take which access specifier.

Java

14th Mar 2020, 6:04 AM
Sanjeev Kumar
Sanjeev Kumar - avatar
4 Answers
+ 6
When no access modifier is specified for a class , method or data member , it is said to be having the "default" access modifier means they can access only within the same package.
14th Mar 2020, 6:34 AM
Shruti
Shruti - avatar
+ 5
Its not nessary to write specifier for every method and member veriable but if you want to access method and veriable outside of that package than you should need public access specifier
14th Mar 2020, 9:08 AM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
+ 4
It take package private
14th Mar 2020, 8:06 AM
Sumit Programmer😎😎
Sumit Programmer😎😎 - avatar
0
Means for private,public and protected specifier......I will have to write before method and data member ......if I want to use of these
14th Mar 2020, 8:33 AM
Sanjeev Kumar
Sanjeev Kumar - avatar