LATEST

Tuesday, April 28, 2020

JAVA MCQS PART 02

JAVA MCQS PART 02

1.  ______ tag is an extension to HTML that can enclose any number of JavaScript statements.
A.  <SCRIPT>          
B.   <BODY>        
C.  <HEAD>            
D.  <TITLE>
Ans: A

2.  How does JavaScript store dates in a date object?
A.  The number of milliseconds since January 1st, 1970
B.   The number of days since January 1st, 1900
C.  The number of seconds since Netscape's public stock offering.
D.  None of the above
Ans: A

3.  Which of the following attribute can hold the JavaScript version?
A.  LANGUAGE         
B.   SCRIPT       
C.  VERSION      
D.  None of the above
Ans: A

 
4.  What is the correct JavaScript syntax to write "Hello World"?
A.  System.out.println("Hello World")  
B.   println ("Hello World")
C.  document.write("Hello World")    
D.  response.write("Hello World")
Ans: C

5.  Which of the following way can be used to indicate the LANGUAGE attribute?
A.  <LANGUAGE="JavaScriptVersion">
B.   <SCRIPT LANGUAGE="JavaScriptVersion">
C.  <SCRIPT LANGUAGE="JavaScriptVersion">    JavaScript statements…</SCRIPT>
D.  <SCRIPT LANGUAGE="JavaScriptVersion"!>    JavaScript statements…</SCRIPT>
Ans: C

6.  Inside which HTML element do we put the JavaScript?
A.  <js>         
B.   <scripting>         
C.  <script>      
D.  <javascript>
Ans: C

7.  What is the correct syntax for referring to an external script called " abc.js"?
A.  <script href=" abc.js">                    
B.   <script name=" abc.js">
C.  <script src=" abc.js">                      
D.  None of the above
Ans: C

8.  Which types of image maps can be used with JavaScript?
A.  Server-side image maps             
B.  Client-side image maps
C.  Server-side image maps and Client-side image map 
D.  None of the above
Ans: B

9.  Which of the following navigator object properties is the same in both   Netscape and IE?
A. navigator.appCodeName                  
B. navigator.appName
C. navigator.appVersion                           
D. None of the above 

Ans: A

10.  Which is the correct way to write a JavaScript array?
A. var txt = new Array(1:"tim",2:"kim",3:"jim")
B. var txt = new Array:1=("tim")2=("kim")3=("jim")
C. var txt = new Array("tim","kim","jim")
D. var txt = new Array="tim","kim","jim"
Ans: C

No comments:

Post a Comment