Core Java - Interview Questions and Answers for 'Access modifier' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Core Java - Interview Questions and Answers for 'Access modifier' - 4 question(s) found - Order By Rating

 Q1. What is the difference between scope and access modifiers ?Core Java
Ans. Scope modifiers changes the scope of a particular element or a method. For ex - static changes the scope of that of class and not of object.

Access modifiers changes the access priviledges of a particular element or a method. For ex - private , public etc.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     scope modifiers   access modifiers   scope vs access modifiers     Asked in 2 Companies      basic


 Q2. What are access and non access modifiers ?Core Java
Ans. Access modifiers are the java reserved keywords that changes the access privileges on a class , method , element etc. For example - public , private and protected.

Non Access modifiers are the java modifiers other than access modifiers. For example - static , final, abstract, synchronized, transient, volatile etc.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     access modifiers     Asked in 2 Companies


 Q3. Name few access and non access Class Modifiers ?
Ans. private , public and protected are access modifiers.

final and abstract are non access modifiers.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   access specifiers   access modifiers   modifiers   access control


 Q4. What is the difference between public class and class ?Core Java
Ans. Class without any access specifier has the default scope i.e it can be accessed by any class within same package.

Class declared public can be accessed from anywhere.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   access specifier   access modifiers   public class   class

Try 1 Question(s) Test



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: