Answer Posted / sumit pal singh
In java there are four type of access modifier.
1.private:It is accessible only within the class.
2.default:If you don't use any modifier then it is treated as default bydefault .it is accessible within package.
3.protected:The protected access modifier is accessible within package and outside the package but through inheritance only.
4.public:The public access modifier is accessible everywhere. It has the widest scope among all other modifiers.
The access Modifier in java specify the scope of data member,method,constructor and class.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is javac in java?
What is the difference between int and integer in java?
Can we return null in java?
What are data types in programming?
Why generics are used in java?
Explain the protected field modifier?
What is the access scope of a protected method?
what is a thread pool in java and why is it used?
Where is const variable stored?
What is arrays fill in java?
Which methods are used during serialization and deserialization process?
What is jit compiler in java?
Enlist few advantages of inheritance?
What is binary search in java?
What restrictions are placed on method overriding?