2.+ operator in java is overloaded e.g. String concatenation. How we can achieve this? Though Java specifies certain overloaded operators, it does not support user-defined overloading of operators. 3.What methods of a class can be overridden? Public and protected 4.Can overridden method have different return type?No 5.What is static and dynamic binding? 6.What parts in java are static bound and dynamic bound? 7.What is difference between an interface and abstract class? Abstract class can provide some default implementation and delegate some to subclasses. Interfaces do not provide any implementation. 8.What is difference between singleton design pattern and a class with all static methods?Singleton can be changed to incorporate multiple instances while it is not possible with static method approach. 9.What are servelet filters? A filter is an object that can transform the header or content or both of a request or response. Can be attached to any web resource. 10.Explain stateless session beans lifecycle 11.Who is responsible for linking remote EJB interface and actual implementation? 12.What are advantages of Web services over Corba?HTTP based so internet friendly. Firewall filtering possible. 13.How does JVM achieve synchronization?JVM uses monitors and wait sets to implement synchronization. Monitor is data structure which can save information about single thread only. Each object has a monitor associated with it. Threads waiting for the object are put in wait set. 14.How can we enforce static binding for Java code?
Good, that u share ur interview questions with others, I like that. Looks like u had an interview on J2EE, Servlets n Core java. Could u please let me know any good books I can go thru for my preparation to be enhanced. Good books or links regarding the EJB Questions (Mostly with answers ). Actually I want any good site/book which can explain me the main differences between the concepts(like CMP vs BMP,Local Vs Home ...).
Wasn't sure about the static and dynamic binding so I asked someone. Dynamic binding occurs at runtime using reflection. Correct? Can someone shed some light on static binding? I'm assuming it involves polymorphism??? Also, regarding overriding, one picky question that can surface during an interview is the following: ClassA has a private MethodB and ClassB extends ClassA. (1) Can ClassB can also have a MethodB with the exact same signature and return type. The answer is yes. (2)Is ClassB's MethodB overriding ClassA's method? The answer is No. Why? Since ClassA's method is private, ClassB will not know it exists.