Java - Interview Questions and Answers for 'Beans' | 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

   



NetBeans

NetBeans is a software development platform written in Java. The NetBeans Platform allows applications to be developed from a set of modular software components called modules.

Link: https://netbeans.org/
   




Interview Questions and Answers for 'Beans' - 27 question(s) found - Order By Newest

 Q1. Difference between Java beans and Spring Beans ?Spring
Admin
info@buggybread.com
Ans. Java Beans managed by Spring IoC are called Spring Beans.

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

   Like      Discuss      Correct / Improve     java   spring   beans


 Q2. What bean scopes does Spring support? Explain them.Spring
Admin
info@buggybread.com
Ans. The Spring Framework supports following five scopes -

Singleton
prototype
request
session
global-session

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

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   beans   beans scope   at&t  fidelity


 Q3. Why are Getter and Setter better than directly changing and retrieving fields ?

or

What is the significance of variable hiding in Java ?

or

Why it's preferred to keep variables private and allow their access through getter and setter methods ?
Core Java
Admin
info@buggybread.com
Ans. 1. Methods can participate in runtime polymorphism whereas member variables cannot.

For example -

Vehicle vehicle = new Car();

car.getObjVariable();// will return variable defined in Car

whereas

car.variable

will return the variable from Car class irrespective of the object it holds.

2. Validations can be performed before setting the variables.

3. If the input format changes or some other value or calculated value needs to be returned , that can be absorbed by making change ( wrapping ) in the setter and getter. By this the call to method from outside or interface to the object will remain the same.

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

   Like      Discuss      Correct / Improve     java   beans   getter   setter


 Q4. Can we have two beans with same class with different bean id in spring ?Spring2016-10-18 14:18:43

Ans. Yes

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

   Like      Discuss      Correct / Improve     spring beans     MagicBricks


 Q5. Q: What is default scope of bean in Spring framework?
Spring
Admin
info@buggybread.com
Ans. The default scope of bean is Sing leton for Spring framework.

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

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   bean


Very Frequently asked Spring question.
  Q6. What is bean auto wiring?Spring
Admin
info@buggybread.com
Ans. The Spring container is able to autowire relationships between collaborating beans. This means that it is possible to automatically let Spring resolve collaborators (other beans) for your bean by inspecting the contents of the BeanFactory without using and elements.

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

   Like      Discuss      Correct / Improve     j2ee   spring   mvc   frameworks   web applications   autowiring   beans   at&t   ge     Infosys  HCL Technologies  Tata Consultancy  Wipro  PwC  Tech Mahindra  AT&T  General Electric  Sophos        frequent


 Q7. What is IDE ? List few Java IDE ?Tool
Admin
info@buggybread.com
Ans. IDE stands of Integrated Development Environment. Few Java IDE's are WSAD ( Websphhere Application Developer ) , RAD ( Rational Application Developer ) , Eclipse and Netbeans.

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

   Like      Discuss      Correct / Improve     java   ide   ide   java development   wsad   rad   eclipse   netbeans


 Q8. What ate the getter and setter methods ?
Admin
info@buggybread.com
Ans. getters and setters methods are used to store and manipulate the private variables in java beans. A getters as it has name, suggest retrieves the attribute of the same name. A setters are allows you to set the values of the attributes.

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

   Like      Discuss      Correct / Improve     java   java beans   getter   setter


Frequently asked in Phone Interviews.
 Q9. What the Bean scopes provided by Spring ?Spring
Admin
info@buggybread.com
Ans. Singleton , Prototype , Request , Session , global-session

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

   Like      Discuss      Correct / Improve     spring framework   bean scope   general electric   ge



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q10. When should we use prototype scope and singleton scope for beans ?Spring
admin
info@buggybread.com
Ans. We should use singleton scope for beans when they are stateless and prototype when they are stateful.

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

   Like      Discuss      Correct / Improve     spring   bean scope   general electric   ge


 Q11. How to generate getters and setters automatically in eclipse ?Eclipse
Admin
info@buggybread.com
Ans. Right Click -> Source -> Generate Getters and Setters.

and it will open up a dialog wherein we can select the fields to generate Getters and Setters.

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

   Like      Discuss      Correct / Improve     eclipse   java beans


 Q12. Should we have instance variables in the Spring Bean which has been scoped as Singleton ?Spring
Admin
info@buggybread.com
Ans. No, if required we should only have final variables.Bean scoped singleton means that only one instance of the bean will be created and will be shared among different requests and hence instance variables will get shared too.

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

   Like      Discuss      Correct / Improve     java   singleton   spring framework   spring beans


 Q13. Which class provides the enumerated value for Bean Scope ?

a. BeanDefinition
b. ConfigurableBeanFactory
c. WebApplicationContext
d. All of the Above
Spring
Anonymous
Ans. All of the Above

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

   Like      Discuss      Correct / Improve     spring   spring beans   spring bean scope


 Q14. What is a Java Bean ? How is it different from other Java classes ?

Ans. A Java bean is a class which abides by following conventions:

Core of the object is member elements and not operations ( methods )

Member Elements can be accessed by getters (and setters if those properties are not read-only).

serializable.

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

   Like      Discuss      Correct / Improve     java bean   javabean   pojo   classes      basic        frequent


 Q15. Which type of EJB can use bean pooling?Java EE2017-03-09 11:38:12

Ans. Stateless Session Beans

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

   Like      Discuss      Correct / Improve     EJB  java beans     ADP


 Q16. What is the use of @Bean annotation in Spring ?Spring2017-05-16 19:35:49

Ans. There are 2 ways to specify dependencies in Spring, one by the way of specifying beans in config files and other is by specifying annotations like @Bean, @Component , @Service etc to let spring know of the dependencies.

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

   Like      Discuss      Correct / Improve     spring bean annotation  spring annotations


 Q17. What is the difference between Elastic Compute Cloud and Elastic Beanstalk ?AWS2017-06-02 12:55:24

Ans. EC2 is Amazon set of services for creating the server and deals with infrastructure configurations like instances, volume, load balancer,security groups etc.

whereas

Elastic Beanstalk provides set of services for creating Environment and managing application environments like creating environment,Logs,Health and Monitoring,events etc.

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

   Like      Discuss      Correct / Improve     Elastic Compute Cloud   EC2   Elastic Beanstalk


 Q18. What are the types of applications we can create using Elastic Beanstalk ?AWS2017-06-02 12:59:14

Ans. Web Server and Worker

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

   Like      Discuss      Correct / Improve     elastic beanstalk


 Q19. What is the difference between single instance Web environment and Load Balanced Auto Scaling ? AWS2017-06-07 13:20:04

Ans. Single instance means there is only 1 instance that will bear all the traffic load whereas Load balanced server means that there will be a cluster of servers that will host the application and load will be balanced distributed among them. Auto Scaling means that the number of instances will be expanded / shrunken based on the rule. Rule could be the traffic count , response time etc.

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

   Like      Discuss      Correct / Improve     load balancing  auto scaling  aws  elastic beanstalk



Do you think these are the Best Java Frameworks ?

OpenXavaSPRING MVCApache StripesCheck everything
that is Best in Java

Click Here



 Q20. What do you understand by "Scaling Trigger" ?Server2017-06-16 08:23:20

Ans. It's a configuration for auto scaling environment that specify the attributes / conditions for scaling instances up and down. For example - We may like environment to scale up when the number of requests / sec increases a particular threshold and scale down when it decreases below a threshold.

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

   Like      Discuss      Correct / Improve     AWS  Amazon AWS  Amazon EC2  Elastic Beanstalk  Auto Scaling  Scaling Trigger


 Q21. How can we know how many instances are currently in service within an Elastic Beanstalk environment ?AWS2017-06-16 08:25:40

Ans. We can go to respective environment and check configuration and then scaling. It mentions that as current status like

Current status:

2 instance(s) in service, Min: 1, Max: 4


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

   Like      Discuss      Correct / Improve     AWS  Amazon AWS  Amazon EC2  Elastic Beanstalk  Auto Scaling


 Q22. Difference between ApplicationContext and BeanFactory ?Spring2017-06-23 11:50:50

 This question is still unanswered. Can you please provide an answer.


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

   Like      Discuss      Correct / Improve     ApplicationContext  BeanFactory   ApplicationContext vs BeanFactory        frequent


 Q23. Explain inner beans in Spring.Spring2017-06-23 11:51:53

 This question is still unanswered. Can you please provide an answer.


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

   Like      Discuss      Correct / Improve     spring  spring beans   spring inner beans


 Q24. What is a session bean ?Java EE2017-07-05 11:58:31

 This question was recently asked at 'BirlaSoft'.This question is still unanswered. Can you please provide an answer.


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

   Like      Discuss      Correct / Improve     session bean   java bean     BirlaSoft


 Q25. What are the disadvantages of Bean Auto Wiring in Spring ?Spring2017-08-04 09:16:31

Ans. It can always be overridden with explicit wiring. Moreover it's confusing if we use both explicit as well as explicit wiring in the project.

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

   Like      Discuss      Correct / Improve     Spring beans  auto wiring  autowiring


 Q26. What is the difference between Singleton and Prototype Bean scope in Spring ?Spring2017-08-20 06:35:16

 This question was recently asked at 'Infosys Technologies'.This question is still unanswered. Can you please provide an answer.


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

   Like      Discuss      Correct / Improve     Spring beans  singleton bean scope  prototype bean scope     Infosys Technologies


 Q27. Which type of EJB can use bean pooling?Java EE
a. Session Beans
b. Stateless Session Beans
c. Stateless Sessionless Beans
d. Any EJB Beans

Ans.b. Stateless Session Beans



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: