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. Message queues implement an asynchronous communication pattern between two or more processes/threads whereby the sending and receiving party do not need to interact with the message queue at the same time. Messages placed onto the queue are stored until the recipient retrieves them. Message queues have implicit or explicit limits on the size of data that may be transmitted in a single message and the number of messages that may remain outstanding on the queue.
Help us improve. Please let us know the company, where you were asked this question :
Q67. Why Spring boot is preferred over Spring MVC ?
Ans. Spring Boot aims to shorten the code length and provide you with the easiest way to develop a web application. It helps create a stand-alone application with less or almost zero-configuration.
Help us improve. Please let us know the company, where you were asked this question :
Ans. We initialize two variables first and second to INT_MIN as,
first = second = INT_MIN
then Start traversing the array,
If the current element in array say arr[i] is greater
than first. Then update first and second as,
second = first
first = arr[i]
If the current element is in between first and second,
then update second to store the value of current variable as
second = arr[i]
then Return the value stored in second.
Help us improve. Please let us know the company, where you were asked this question :
Ans. If there is a situation to remove duplicates values from an arrayList. Developer implemented using legacy for-loop where I suggested to use Linked hash set to remove duplicates from the list.
Help us improve. Please let us know the company, where you were asked this question :
Ans. we use serialization when we send response to client in JSON format.(the process of converting model object into json is nothing but serialization
Help us improve. Please let us know the company, where you were asked this question :
With Spring, we use the @ComponentScan annotation along with the @Configuration annotation to specify the packages that we want to be scanned. @ComponentScan without arguments tells Spring to scan the current package and all of its sub-packages.
Help us improve. Please let us know the company, where you were asked this question :
Ans. These annotations are used to create Spring beans automatically in the application context. The main stereotype annotation is @Component . @Controller: Which is used to create Spring beans at the controller layer. The stereotype annotations in spring are @Component, @Service, @Repository and @Controller
Help us improve. Please let us know the company, where you were asked this question :
Ans. Deserialization. In serialization, we can save the object of a byte stream into a file or send over a network. Suppose if you serialize the Singleton class, and then again de-serialize that object, it will create a new instance, hence deserialization will break the Singleton pattern.
To overcome this issue, we need to override readResolve() method in the Singleton class and return the same Singleton instance.
Help us improve. Please let us know the company, where you were asked this question :