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 |
when,where and how to use abstract class and interface
What is toarray method in java?
use of wrapper classes?
Can we instantiate interface in java?
Can a class be subclass of itself?
Which class is used by server applications to obtain a port and listen for client requests?
what is ststic with example
What is entry in java?
Difference between java and javascript
StringBuilder s = new StringBuilder("Hello Mom");s.append(",I mean,Mother"); Response.Write(s.ToString()); String s = "Hello Mom"; s+ = ",I mean Mom"; Response.Write(s); Which is faster ? which uses the most memory?
What are non-access modifiers?
What is a java lambda expression?