AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
![]() ![]() When you access a method using interface type, it involves scanning to multiple implementation. Regarding, whether abstract class is faster than interface, that's true, because of different byte code generated, when calling a method using abstract class or interface. Since all JAR will be using same class name, using different JAR with different provider make things simple, you don't need any runtime configuration, because the class which will be available in Classpath will be instantiated.ģ) Make sure to include correct jar during build time. Reuters implementation comes with Reuters JAR, Bloomberg comes with bloomberg.jar and Wombat comes with there own JAR.Ģ) Make them to implement MarketData interface as MarketDataImpl. Regarding Answer 6, related to design of Market data provider, I think there are couple of more approaches.ġ) Let different implementation comes with different JAR file e.g. How do we ensure an application is 100% available? can someone answer this please?ĭoes Design patterns help in memory management? Keep doing and helping people to clear there doubts and crack java interviews. Novemat - Can you please share some detailed answers or design for ATM machine example or Market data example? One thing i want to high light here do you think this questions are from design pattern or Design consideration ? I think design pattern is bit different? This comment has been removed by the author. Once again thanks a lot.Ĭan anyone please share Java design pattern questions asked on Capegemini and Infosys interviews ? I have 6 years experience in Java and found that many design pattern questions actually appeared in Senior Java interview. One of the best list of java design interview questions and answers I found around web, Thanks for sharing this great list of Java design pattern interview questions and answers. Pls, share your thoughts on the questions. I too have an article on interview questions on design patterns. You have a very good collection of questions on design patterns Javin. If you feel otherwise please feel free to let me know. ![]() So, I would say this abstract class, Interface thingi is non-existent or inconsequential now :) However, these days, the fire-power that computers have (in terms of processing) is many times higher than what it was just even a couple of years ago + JVMs have been optimized over generations. ![]() Since at runtime the JVM may have to scan through multiple interfaces to find a method while it needs to scan only one class, an abstract class could have given a marginally better performance when compared to an interface. In the olden days this could've been true for the following reason:Ī Class can extend from only one parent class while it can implement multiple interface. Question like How will you ensure Scalability, high avaibility should be asked on software design part as well.Īctually speaking these days, the difference in performance between an Abstract class and an Interface could be negligible or non-existent. J2EE specific patterns like MVC, ViewResolver patter, Front Controller patter, Service Locator are missing from your list of design pattern question. Though decorator, Singleton, Factory are both applicable to Java and J2EE. Hi trgoofi, I have also read this somewhere, but I logic is that abstract class can still participate in static binding by declaring static method but since interface can not have any method implementation all binding will be dynamic.I am still looking for more convincing and detailed reason and let you know if I found it, if you have more convincing logic, please let us know.ĭesign pattern questions are more popular on J2EE interviews rather than in core Java interviews. Can you explain how "abstract class is slightly faster than interface" ? ![]()
0 Comments
Read More
Leave a Reply. |