What is access modifiers?
Answer / 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 |
How does abstract modifier work?
Can we sort array in java?
Can we override private constructor in java?
What is basic syntax?
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
Question 6 [9] 6.1 In what situations (in general) would you use a TreeMap? (3) 6.2 In what situations (in general) would you use a HashSet to store a collection of values?
Can each java object keep track of all the threads that want to exclusively access it?
How do you check if a character in a string is a digit or letter?
What is an interoperable application in java ?
Is java developer a good career?
What is size of int in java?
How to perform Singleton of the java class object on multi JVM?