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. Abstract classes provide a mechanism of interfacing ( using abstract method ) as well as code reuse through inheritance ( extending abstract class )
Comparing to concrete class they have an advantage of providing interface which a concrete class doesn't provide.
Comparing to interfaces they have an advantage of providing code reuse through inheritance which interfaces dont provide.
Q1658. How can you extract integers from string values and add (sum it up) all the extracted integers? e.g "James34long4island322in3rdAvenue" ---> 34 4 322 3 = 363
Ans. runtime polymorphism or method overriding doesn't require method name and signature to be different whereas compile time polymorphism or method overloading requires method name to be same but the signature to be different.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Generally Rest services don't have any registry like we have WSDL is SOAP and hence don't have a way to know the end points without looking at either the url mapping in controller or client code. Some restful service publish WADL (Web Application Description Language) and hence clients can locate the service end points.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Goto statement results in unstructured jumps in control from one code location to another and hence makes the code very difficult
to read , maintain and debug. Moreover Goto can always be replaced using other statements like break / continue and hence results in structured movement of programming control.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Convention over configuration is a way of software design used by frameworks that attempt to decrease the number of decisions that a developer is required to make without necessarily losing flexibility. The objective is to reduce the unnecessary configurations and follow conventions to accomplish that. For example - DB Entity and DB Table name conventionally should be same and hence shouldn't require configuring mapping between the two.
"Spring Boot" and "Ruby on Rails" have adopted this design principle.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Yes, It may result in some loss of flexibility as the application has to follow all conventions. Moreover it can contradict with other design paradigms or principles used in the application or framework.
Help us improve. Please let us know the company, where you were asked this question :
Ans. Hibernate mapping configurations are used for mapping hibernate entities and corresponding DB Tables. Conventionally Entities and Table can share the same name and hence framework can provide implicit mapping instead of explicit mapping through configurations. Though it may result in little loss of flexibility in extreme cases but will work with all applications following the convention.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It is used for intercepting the request. It's primary use is to implement security policy. All or specific request types can be intercepted and hence forwarded to authentication / authorization module so as to facilitate authorized requests to application.
Help us improve. Please let us know the company, where you were asked this question :
Ans. It introduces a layer of adaptations before it reaches the final and desired interface.
Moreover sometimes all requests are forwarded to adapter class. Some of such requests doesn't even require any sort of adaptions as they are qualified to call the final interface directly and introducing overheads.
Help us improve. Please let us know the company, where you were asked this question :