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.
Interview Questions and Answers for 'Script' - 81 question(s) found - Order By Newest
Very frequently asked. Among first few questions in almost all interviews. Among Top 5 frequently asked questions. Frequently asked in Indian service companies (HCL,TCS,Infosys,Capgemini etc based on multiple feedback ) and Epam Systems
Ans. "equals" is the method of object class which is supposed to be overridden to check object equality, whereas "==" operator evaluate to see if the object handlers on the left and right are pointing to the same object in memory.
x.equals(y) means the references x and y are holding objects that are equal. x==y means that the references x and y have same object.
Sample code:
String x = new String("str");
String y = new String("str");
System.out.println(x == y); // prints false
System.out.println(x.equals(y)); // prints true
Ans. Deployment Descriptor which is usually web.xml is used to specify the classes, resources and configuration of the application and how the web server uses them to serve web requests.This file is usually added to WEB-INF folder and contains following
* Servlet entries and url mapping
* Plugins
* Some info regarding authentication / filters
* Landing Page
* Event Handlers
Help us improve. Please let us know the company, where you were asked this question :
Ans. The jsp scriptlet tag can only declare variables not methods whereas jsp declaration tag can declare variables as well as methods.
The declaration of scriptlet tag is placed inside the _jspService() method whereas The declaration of jsp declaration tag is placed outside the _jspService() method.
Help us improve. Please let us know the company, where you were asked this question :
LikeDiscussCorrect / Improve  j2ee   jsp   scriptlet tag   declaraation tag   web application
Ans. A cookie is a small piece of text stored on a user's computer by the browser for a specific domain. Commonly used for authentication, storing site preferences, and server session identification.
Help us improve. Please let us know the company, where you were asked this question :
Q6. Which of the following is fastest to locate the DOM element ?
a. document.getElementById b. document.getElementByName c. document.ElementName.SubElementName d. They all result in similar performance in retrieving the DOM element.
Ans. document.ElementName.SubElementName
Help us improve. Please let us know the company, where you were asked this question :
Q7. Why should we have Javascript method definitions within HTML Head section ?
a. Its safe to have javascript code within head section b. Head section gets loaded even if there is any error in loading HTML page c. Head section gets executed first and hence assure that js method definition will be loaded before they are called d. So that we can have method definition and method call at the same place
Ans. Head section gets executed first and hence assure that js method definition will be loaded before they are called
Help us improve. Please let us know the company, where you were asked this question :
Ans. No, there is no relationship between web.xml and spring.xml but you have to configure spring.xml in web.xml in order initialize beans when application starts up
Help us improve. Please let us know the company, where you were asked this question :
Ans. filter tag speficies the filter name and respective class for handling filter action whereas filter mapping maps the filter to the url patterns ( specifying the url that needs to be intercepted )
Help us improve. Please let us know the company, where you were asked this question :
Ans. By specifying XSiteScriptingProtection within wc-server.xml. Prohibited characters and attributes are specified within XSiteScriptingProtection to protect the application from any XSS attach.
Help us improve. Please let us know the company, where you were asked this question :
Ans. A falsy value is something which evaluates to FALSE, for instance when checking a variable. There are only six falsey values in JavaScript: undefined, null, NaN, 0, "" (empty string), and false of course.
Help us improve. Please let us know the company, where you were asked this question :
Q16. How would you choose your favorite company name for e.g. three companies are given in radio buttons Infosys, TCS and Aricent. Do You need to loop trough all radio buttons and select your favorite company or can just get the selected value.