JAVA - J2EE Training Guide

Are You Looking For JAVA/J2EE Online Training ?

Fill in your details in below form, we will get back to you

Powered by Blogger.

Thursday, 13 November 2014

Hard Questions on Java Script
  • 1. What is the use of Math Object in Java Script ?
The math object provides you properties and methods for mathematical constants and functions.
  • 2. What’s relationship between Java Script and ECMA Script ?
ECMAScript is yet another name for JavaScript (other names include Live Script). The current JavaScript that you see supported in browsers is ECMAScript revision 3.
  • 3. Are JavaScript and J Query different ?
 J Query is a quick as well as concise JavaScript Library that simplifies HTML document traversing, animating, event handling, & Ajax interactions for the purpose of quick web development needs. So although they are not entirely different, both are not the same either.
  • 4. Explain the strict mode in Java Script ?
  The strict mode ensures that if functions are not properly thought it, those are disabled. It also kept a check on potentially unsafe actions and throw errors when it happens.
  • 5. Explain Java Script closures ?
A basic overview of  JavaScript closures is that it is a stack-frame which is not de-allocated when the function returns.
  • 6. What is Java script namespacing? How and where is it used ?
 Using global variables in Java Script is evil and a bad practice. That being said, namespacing is used to bundle up all your functionality using a unique name. In JavaScript, a namespace is really just an object that you’ve attached all further methods, properties and objects. It promotes modularity and code reuse in the application.

  • 7. How to read and write a file using Java Script ?
 I/O operations like reading or writing a file is not possible with client-side Java Script. However , this can be done by coding a Java applet that reads files for the script.
  • 8. What can JavaScript programs do ?
 Generation of HTML pages on-the-fly without accessing the Web server. The user can be given control over the browser like User input validation Simple computations can be performed on the client\\\'s machine The user\\\'s browser, OS, screen size, etc. can be detected Date and Time Handling.
  • 9. How to set a HTML document\\\'s background color ?
 document.bgcolor property can be set to any appropriate color.
  • 10. What does is NaN function do ?
 Return true if the argument is not a number.
  • 11. Is a Java Script script faster than an ASP Script ?
Yes.Since javascript is a client-side script it does require the web server\\\'s help for its computation,so it is always faster than any server-side script like ASP,PHP, etc.
  • 12. Are Java and JavaScript the Same ?
 No.java and javascript are two different languages.
    Java is a powerful object - oriented programming language like C++,C whereas Javascript is a client-side     scripting language with some limitations.
  • 13. How to embed Java Script in a web page ?
 JavaScript code can be embedded in a web page betweentags.
  • 14. How to get the contents of an input box using Java Script ?
 Use the \\\'value\\\' property.
      var myValue = window.document.getElementById(\\\'MyTextBox\\\').value;

  • 15. How to determine the state of a Check box using JavaScript ?
 var checkedP = window.document.getElementById(\\\'myCheckBox\\\').checked;
  • 16. What is the difference between Client side JavaScript and Server side JavaScript ?
 Client side java script comprises the basic language and predefined objects which are relevant to running java script in a browser. The client side java script is embedded directly by in the HTML pages.
  • 17. How to inheritance works in Java Script ?
 Java Script has a somewhat unique inheritance model and a good understanding of it is crucial to using Java Script in larger applications, Kubasik says.  “We are looking for the applicant to discuss not only prototypes, and how that affects inheritance, but in what ways this can be more flexible than classical inheritance models seen in Java and C#.”
  • 18. Where are cookies actually stored on the hard disk ?
The storage of cookies on the hard disk depends on OS and the browser. The Netscape navigator on Windows, the file cookies.txt contains all the cookies.
  • 19. What is the undefined value ?
 Undefined value: A value that is not defined and has no keyword is known as undefined value. For example in the declaration, int number; the number has undefined value.
  • 20. How to set the cursor to wait in Java Script ?
The cursor can set to wait in JavaScript by using the property ‘cursor’ property. The following example illustrates the usage.
  • 21. What are windows object and navigator object in Java Script ?
Windows object is top level object in Java script. It contains several other objects such as, document, history, location, name, menu bar etc., in itself. Window object is the global object for Java script that is written at client-side.
  • 22. How to detect the operating system on the client machine in Java Script ?
 The navigator.appVersion string should be used to find the name of the operating system on the client machine.
  • 23. How to set a HTML document\\\'s background color in Java Script ?
Using document object the back ground color can be changed by JavaScript.
  • 24. What are undefined and undeclared variables ?
 Undeclared variables are those that are not declared in the program (do not exist at all),trying to read their values gives runtime error.But if undeclared variables are assigned then implicit declaration is done .
         Undefined variables are those that are not assigned any value but are declared in the program.Trying to read such variables gives special value called undefined value.
  • 25. What is the difference between an Alert box and a Confirmation box ?
  An alert box displays only one button which is the OK button whereas the Confirm box displays two buttons namely OK and cancel.

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.