Core Java - Interview Questions and Answers for '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 'Modifier' - 9 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. Can a class be declared "protected" ?Core Java
Ans. No, only methods can be declared protected.

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

   Like         Discuss         Correct / Improve     protected  modifiers


 Q3. Which of the following applies to "private"?

It is a keyword
It is a modifier
It is an access modifier
Core Java
Ans. Yes, all of them applies to private keyword. It is an access modifier.

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

   Like         Discuss         Correct / Improve     keyword  modifier


 Q4. Which of the following applies to Final ?

It is a keyword
It is a modifier
It is an access modifier
Core Java
Ans. It is a keyword and a modifier but not an access modifier.

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

   Like         Discuss         Correct / Improve     keyword  modifier


 Q5. What is the difference between a keyword and a modifier ?Core Java
Ans. Keywords are the reserved words that have a pre defined meaning for a compiler whereas modifiers are the type of keywords that modifies the state or definition of a programming construct.

for, while are keywords but not modifiers.
private , public , final , abstract etc are keywords as well as modifiers.

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

   Like         Discuss         Correct / Improve     keyword  modifier


 Q6. 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


 Q7. Is synchronized a keyword , modifier, identifier? what is it ?Core Java
Ans. synchronized is a keyword and a modifier. The synchronized keyword is used to indicate that a method can be accessed exclusively by one thread at a time.

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

   Like         Discuss         Correct / Improve     synchronization  synchronized  modifier  identifier     Asked in 2 Companies


 Q8. 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


 Q9. 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: