Documente Academic
Documente Profesional
Documente Cultură
(a) The body of the web page will not contain any text
(b) The body of the web page will contain the text <h1> hello world </h1>
(c) The body of the web page will contain the text hello world as an H1 heading
(d) The background color of the web page will be green
(e) document.write("<h1> hello world </h1 >); is a comment.
9. The following statements are about three important browser objects in
JavaScript.
I. window object : The highest of all objects in the client-side JavaScript object
hierarchy.
II. navigator object : A collection of information about the browser. Useful in
browser sniffing.
III. document object : Provides access to the document being viewed.
Which of the above statements is/are true?
(a) Only (I) above
(b) Only (II) above
(c) Only (III) above
(d) Both (I) and (II) above
(e) All (I), (II) and (III) above.
10. Consider the following script:
<html>
<head><title>JavaScript</title></head>
<body>
<script language="JavaScript">
var a=80
var b=(a==80 ? "pass" :"fail");
document.write(b)
</script>
</body>
</html>
What will be the output of the above script?
(a) pass
(b) fail
(c) null
(d) 80
(e) Error at line 6.
Answers
Answer Reason
1. D
All the other options are wrong and incorrect for the question asked.
2. E
All the other options are wrong and incorrect for the question asked.
3. E
4. A
All the other options are correct for the question asked.
5. E
6. C
define
7. D
As the remaining all the options are correct and valid for JavaScript.
8. A
9. E
true.
10. A
Because the outcome of the ternary operator.
11. The following web page is loaded into a web server:
<html>
<head><title>JavaScript question</title></head>
<body>
<script language="JavaScript">
book = new Array(1,2,3,4,5,6,7,8);
document.write(book[1]);
book[10]=10;
document.write(book[10]);
</script>
</body>
</html>
Once the above web page is loaded what will its body contain?
(a) 2
10
(b) 1
10
(c) 110
(d) 210
(e) Error at line 7.
12. Which of the following statements is false regarding Cookies?
(a) Cookies are programs which run in the background of the web-client
(b) Cookies have the potential of being used to violate the privacy of users
(c) Cookies are very helpful in keeping track of users in developing online
shopping cart applications, personalized portals and in advertising on web sites
(d) Cookies cannot contain more than 4Kb of data
(e) Cookies usually contain data in the form of name = value pairs.
13. Consider the following script:
<html>
<head><title>JavaScript</title></head>
<body>
<script language="JavaScript">
document.write((125/5)%12);
</script>
</body>
</html>
What would be the output of the above script?
(a) 0
(b) 1
(c) 2.083
(d) 3
(e) 25%12.
14. Which of the following statements is true regarding HTTP?
(a) Web browsers use only HTTP as a communication protocol with servers
Answers
Answer Reason
11. D Because book[1] prints 2 and book[10] prints 10
12. A Because cookies are not programs.
13. B 125/5 is 25 and 25%12 is 1(Remainder)
14. B All the other options are wrong and incorrect for the question asked.
15. C All the other options are wrong and incorrect for the question asked.
(b) False
(c) Null
(d) EOF
(e) True.
25. Which class in JSP provides the capability to implement a growable
array of objects?
(a) Array class
(b) GrowAbleArray class
(c) Container class
(d) Vector class
(e) DynamicArray class.
26. In JSP, the classes that allow primitive types to be accessed as objects
are known as
(a) Primitive classes
(b) Object classes
(c) Boxing classes
(d) UnBoxing classes
(e) Wrapped classes.
27. In JSP, a Canvas object provides access to a Graphics object via one of
its method called:
(a) getCanvas()
(b) getGraphics()
(c) paint()
(d) getPaint()
(e) accessGraphics().
28. In ASP the function which returns the current system date is:
(a) getDate()
(b) Date()
(c) Now()
(d) getCurrentDate()
(e) CurrentDate().
29. In ASP the function which returns an expression formatted as a date or
time is:
(a) FormatDateOrTime()
(b) FormatDateAndTime()
(c) FormatTimeDate()
(d) FormatDateTime()
(e) FormatDT().
30. The function returns a Boolean value that indicates whether a specified
expression can be evaluated as a number; in ASP is
(a) IsNumeric()
(b) IsNumber()
(c) IsNotNumeric()
(d) IsNotNumber()
(e) IsNumberOrNot().
Answers
Ans
Reason