Answer Posted / 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 |
Post New Answer View All Answers
Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?
Define an applet in java?
How do you sort in java?
What is bifunction in java?
What are annotations in java?
Can constructor be synchronized?
Can I declare a class as private?
What are byte codes?
How do you sort a string in java?
What is variable length arguments in java?
What are the types of casting?
What is the difference between the boolean & operator and the && operator in java programming?
What is byte value?
How to pass arraylist to stored procedure in java?
Is overriding possible in java?