Search Interview Questions | Click here and help us by providing the answer. Click Correct / Improve and please let us know. |
|
|||
|
| ||||
| Interview Questions and Answers - Order By Newest | ||||
| ||||
| Ans. Ant is procedural, we need to provide information about what to do and when to do through code. Maven is declarative, everything is defined in the pom file. | ||||
| ||||
| Ans. static methods and static elements are shared by all objects of a class and hence could create problem. Static methods are not synchronized by default and hence could create problem when accessed through multiple threads. Static elements are shareable by class and hence state of one object could be altered by another object. Some limitations with Unit testing as not all mocking framework facilitate mocking them. Power mock allows but Mockito doesn't | ||||
| ||||
| Ans. Better Control - If the value is being used at multiple locations , that can be controlled better from single place. Any change would only require making single change. Meaning , Aliasing and Better Readability - Sometimes its easy to read the value by its meaning or alias ( 0 as ZERO or 0 as NEUTRAL_VALUE ). | ||||
| ||||
| Ans. Everytime an object is serialized the java serialization mechanism automatically computes a hash value by passing the meta information for the class. This id is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization | ||||
| ||||
| Ans. Select Name from EMPLOYEE where ID in (Select ManagerEmployeeId from EMPLOYEE Group By ManagerEmployeeId order by count(Id) LIMIT 1) | ||||
| ||||
| Ans. public class SingleTon { private SingleTon() { if (singleTon != null) { throw new RuntimeException("cant not create the object"); } } public Object clone() throws CloneNotSupportedException { throw new CloneNotSupportedException("can not be create"); } static private volatile SingleTon singleTon; public static SingleTon getInstance() { SingleTon singleTon = this.sample; if (singleTon == null) { synchronized (this) { singleTon = this.singleTon; if (singleTon == null) { singleTon = this.singleton = new SingleTon(); } } } return singleTon; } } | ||||
| ||||
| Ans. No, Every entity in hibernate needs to have a key, either primary or composite. If we dont have a primary key on table, there are various ways this problem can be countered. 1. By using composite key on entity ( make sure that the appropriate unique constraint in defined on columns in Database ) 2. By mapping Id in entity to ROWID of table. | ||||
| ||||
| Ans. https://www.tutorialspoint.com/javaexamples/thread_procon.htm | ||||
| ||||
| Ans. Abstract classes provide a mechanism of interfacing ( using abstract method ) as well as inheritance ( extending abstract class ). So they should be used in place of interfaces in case there is some code ( methods ) or object body ( member elements ) that can be reused with inheritance. | ||||
| ||||
| Ans. Purchase condition is the condition that must be fulfilled before a promotion is applied and Reward is the benefit that is passed to customer. For Example - If promotion is "Buy 2 Quantity of X, Get Y Free" , Purchase condition is inclusion of 2 qty of X in Cart. Reward in this case would be 1 qty of Y. | ||||
| ||||
| Ans. In first case the whole loop will terminate as soon as any exception happens in the method calculate ( assuming calculate method is not handling its exception and those are thrown back at the calling method ) In Second case exception will be caught for individual iteration and hence it wont break the loop and will continue for the next iteration. | ||||
| ||||
| Ans. B ctor B ctor B ctor A ctor A ctor | ||||
| ||||
| Ans. http://www.java4s.com/java-servlet-tutorials/difference-between-servletconfig-and-servletcontext-in-java/ | ||||
| ||||
| Ans. a. Create necessary lzx files( template , object definition and properties ), make config entries and then Build open Laszlo project ( for LOBTools ) so that new promotion type should be displayed in management center. b. Create a new promotion type xsl ( promotion type template ) and then map it to the promotion type. | ||||
| ||||
| Ans. By querying the STATUS from the ORDERS table. | ||||
| ||||
| Ans. ADDRESS | ||||
| ||||
| Ans. We can query the DB as follows Select NAME from PX_PROMOTION where STATUS=1; | ||||
| ||||
| Ans. Remove the jsp entry from cachespec.xml. | ||||
| ||||
| Ans. wc-server.xml stores the DB configuration. We can either change it manually or by using setdbtype command. | ||||
| ||||
| Ans. USERREG | ||||
| ||||
| Ans. By making Debug=true within WCSPromotionEngineConfig.xml | ||||
| ||||
| Ans. Step 1 - Create a new policy definition by adding record in tables POLICY, POLICYDESC. Step 3 - Associate commands to the new policy by adding records in POLICYCMD. Step 2 - Associate the new policy with its terms and conditions by adding a record in relationship table POLICYTC. Step 4 - Add reference to the policy in the repective contract xml file. | ||||
| ||||
| Ans. Catalog business policies Catalog business policies define the scope and characteristics of the catalog of products for sale in a store including prices and the categorization of products in a store's catalog. Payment business policies Invoicing, payment, and refund business policies define how a store accepts payments, pays refunds, and the format of a store's invoices. Returns business policies Returns business policies define if refunds are accepted, the time period they are accepted for, and any re-stocking fees applied to returns. Shipping business policies Shipping business policies define the shipping providers a store can use and the charges associated with each type. Referral interface business policies Referral interface business policies define the relationship between a proxy store and a remote store. | ||||
| ||||
| Ans. In the contract xml files. | ||||
| ||||
| Ans. Object Oriented - Java is object oriented but isn't purely object oriented as we have primitives along with objects. Platform Independent - As JVM provides the translation to the Machine code as per the underlying Operating System. Interpreted as well as compiled - Java files are compiled as class files and then class files are interpreted by JVM. Runs on a Virtual Machine - Which is JVM that acts as an independent sub environment. Multi-threaded - As applications can run on single thread as well as multi thread. Modularity - Through usage of Classes , methods and Interfaces. Robust Usage in variety of Application types - Web , Gaming, BigData. | ||||
| ||||
| Ans. Static , Final , Synchronized, private , public , protected, volatile, transient, super, this,import , abstract,native,default (effective java 8), new | ||||
| ||||
| Ans. Braces, i.e () and [] have the highest precedence | ||||
| Ans. Throwable | ||||
| ||||
| Ans. A media access control address is a unique identifier assigned to network interfaces for communications at the data link layer of a network segment. MAC addresses are used as a network address for most IEEE 802 network technologies, including Ethernet and Wi-Fi. | ||||
| ||||
| Ans. An Exception in java is the occurrence during computation that is anomalous and is not expected. Exception handling is the mechanism which is used to handle such situations. | ||||