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 |
How do you allocate memory to object?
What is the difference between DataInputStream and BufferedReader
What are the files generated after using IDL to java compiler?
What is class??
What is a double vs float?
Which one will take more memory: an int or integer?
What is the difference between an argument and a parameter?
Can a class extends itself in java?
What are class members by default?
What are wrapper classes in java?
What is dynamic binding?
What is the purpose of the finally clause of a try-catch-finally statement in java programming?