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
What are the rules for variable declaration?
What design pattern you have used in your project? I answered Factory pattern, how it is implemented? What are its advantage? Do know about Abstract Factory?
What is the difference between heap and stack memory?
Can we override final method?
What is the difference between char and char *?
When can we say that threads are not lightweight process in java?
Can we convert list to set in java?
Does java support function overloading, pointers, structures, unions or linked lists?
What is a nullable field?
how to convert Java project into Maven ?
Is array a class in java?
Is java based on c?
What is size () in java?
What is a treeset in java?
What are the procedures?