Java - Interview Questions and Answers for 'Modifier' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2098 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Modifier' - 8 question(s) found - Order By Newest

 Q1. Name few access and non access Class Modifiers ?
Admin
info@buggybread.com
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


 Q2. What is the difference between public class and class ?Core Java
Admin
info@buggybread.com
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


 Q3. Is synchronized a keyword , modifier, identifier? what is it ?Core Java2017-04-26 19:48:55

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     HCL Technologies


 Q4. What are access and non access modifiers ?Core Java2017-04-26 19:52:14

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


 Q5. What is the difference between a keyword and a modifier ?Core Java2017-04-26 19:55:30

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. Which of the following applies to Final ?

It is a keyword
It is a modifier
It is an access modifier
Core Java2017-04-26 19:56:51

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


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

It is a keyword
It is a modifier
It is an access modifier
Core Java2017-04-26 19:57:30

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


 Q8. Can a class be declared "protected" ?Core Java2017-06-23 08:08:34

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




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

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:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: