Pergunta de entrevista da empresa Sysco LABS

Explain access modifier in Java

Respostas da entrevista

Sigiloso

15 de mar. de 2025

In Java, access modifiers control the visibility and accessibility of classes, methods, and variables. There are four types of access modifiers: 01. public – The member is accessible from anywhere in the program. 02. private – The member is accessible only within the same class. 03. protected – The member is accessible within the same package and by subclasses (even in different packages). 04. default (no modifier) – The member is accessible only within the same package.

Sigiloso

23 de mar. de 2025

Access modifiers in Java control visibility. Public allows global access, private restricts to the class, protected includes subclasses, and default limits to the package.

Sigiloso

31 de mar. de 2025

java access modifiers are used to control access to variables, methods and classes. there are different access modifiers used in java such as public, private, protected.