What is access modifiers?
Answer / 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 |
Differences between traditional programming language and object oriented programming language?
why HashTable not allow null key and value
What is java class writing rules?
What is method with example?
Which sorting is best in java?
What is blank final variable?
What is sizeof () operator?
What are hot spots in Java programming?
Which access specifier can be used with class ?
Which is dependent variable?
What is pojo class in java?
Is treeset sorted in java?