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
Difference between ‘>>’ and ‘>>>’ operators in java?
Why is flag used in java?
Why generics are used in java?
Is special character in java?
Why synchronization is important?
What is a protected void?
Write an algorithm for quick sort?
Write a program in java to calculate the difference between the sum of the odd level and even level nodes of a binary tree.
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
what do you mean by marker interface in java?
What is navigable map in java?
Is there any difference between synchronized methods and synchronized statements?
What is functional interface in java?
Does string is thread-safe in java?
Can a main method be overloaded?