Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Java by (7k points)
What is the default access modifier for a class or a method if I do not mention them explicitly?

1 Answer

0 votes
by (13.1k points)

In Java, if you do not explicitly mention an access modifier to a class it is accessible throughout the same package. The members of the class also have access modifiers like public and protected and the members or methods of the class are also can be accessed throughout the package when the access modifier is not explicitly mentioned.

Related questions

0 votes
0 answers
asked Jun 24, 2021 in Java by Jake (7k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...