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 steps in the jdbc connection?
What are abstract methods in java?
What do you know about the garbate collector?
What are different types of encoding?
Explain throw keyword in java?
How does java pattern compile work?
What is the purpose of default constructor?
State some situations where exceptions may arise in java?
What access modifiers can be used for variables?
What do you mean by append?
Why does java doesnt suuport unsigned values?
What is the requirement of thread in java?
make a method which any number and any type of argument and print sum of that arguments.....
What is a variable declaration?
What is the history of java?