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 |
Add a value x to array from index l to r where 0 <= l <= r <= n-1
What are the differences between unchecked exception, checked exception, and errors?
Is java util list serializable?
how u do unit testing?
What is the difference between a constructor and a method?
does java support default argument in Method?
How do you add spaces in java?
What are concepts of OOPS and how are they implemented in Java?
What is jee6?
What is gc()?
What is the use of :: in java?
What is constructor and virtual function? Can we call a virtual function in a constructor?