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.
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 :
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 :
Ans. Prototype scope - A new object is created each time it is injected/looked up. It will use new SomeClass() each time.
Singleton scope - It is the default scope. The same object is returned each time it is injected/looked up. Here it will instantiate one instance of SomeClass and then return it each time.
Help us improve. Please let us know the company, where you were asked this question :
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 :
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 :
LikeDiscussCorrect / Improve  java   ide   ide   java development   wsad   rad   eclipse   netbeans
Q12. What ate the getter and setter methods ?
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 :
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 :
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 :
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 :