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 |
What are basic keywords?
what really hapens when a object is created using new operator? 1.is it allocates memory to all variables and methods in the class with reference to that object?
what is meant by string pooling?
12 Answers Oracle, Polaris, Tribal Fusion, Wipro,
Can we use return in constructor?
Can we have any code between try and finally blocks?
Can we have return statement in finally clause? What will happen?
Explain 5 io best practices?
how can we synchronize Hash map?
What environment variables do I need to set on my machine in order to be able to run java programs?
What are the performance implications of interfaces over abstract classes?
Brief the life cycle of an applet.
What is array length?