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
How would you dynamically allocate memory to an array?
What do you mean by light weight and heavy weight components?
What is one third plus one third as a fraction?
What is a arraylist in java?
What mechanism does java use for memory management?
What is a pattern what is an anti pattern?
What are implicit objects in java?
What is thread count in java?
Is it possible for a yielded thread to get chance for its execution again?
What are different types of multitasking?
What is finally in Java?
Can we restart a thread already started in java?
Can inner class be public in java?
What is a null point?
What is boolean strategy?