 In C++, there are only three access modifiers.C# extends the number of them to six, while Java has four access modifiers, but three keywords for this purpose.In Java, having no keyword before defaults to the package-private modifier.