Webtech mcq unit-3 - mcqs PDF

Title Webtech mcq unit-3 - mcqs
Course Web Technology
Institution Dr. A.P.J. Abdul Kalam Technical University
Pages 15
File Size 115.7 KB
File Type PDF
Total Downloads 62
Total Views 164

Summary

mcqs...


Description

Unit-3 MCQ(JavaScript, AJAX, Networking) Q 1 - Which of the following is correct about JavaScript?

A - JavaScript is a lightweight, interpreted programming language. B - JavaScript has object-oriented capabilities that allows you to build interactivity into otherwise static HTML pages. C - The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers. D - All of the above.

Q 2 - Which of the following function of String object returns the primitive value of the specified object.

A - toLocaleUpperCase() B - toUpperCase() C - toString() D - valueOf() Q 3 - Which of the following function of Array object creates a new array with all of the elements of this array for which the provided filtering function returns true? A - concat() B - every() C - filter() D - some() Q 4 - Which of the following function of Array object removes the first element from an array and returns that element?

A - reverse() B - shift() C - slice() D - some()

Q5. When a user views a page containing a JavaScript program, which machine actually executes the script? A. The User's machine running a Web browser B. The Web server C. A central machine deep within Netscape's corporate offices D. None of the above

Q6. What should appear at the very end of your JavaScript? The B. The C. The END statement D. None of the above

Q7. Which of the following can't be done with client-side JavaScript? A. Validating a form B. Sending a form's contents by email C. Storing the form's contents to a database file on the server D. None of the above

Q8. 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")

Q9. Inside which HTML element do we put the JavaScript? A. B. C. D.

Q10. What is the correct syntax for referring to an external script called " abc.js"? A. B. C. D. None of the above

Q11. 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("tim","kim","jim") C. var txt = new Array:1=("tim")2=("kim")3=("jim") D. var txt = new Array="tim","kim","jim" Q12. If para1 is the DOM object for a paragraph, what is the correct syntax to change the text within the paragraph? A. "New Text"? B. para1.value="New Text"; C. para1.firstChild.nodeValue= "New Text"; D. para1.nodeValue="New Text"; Q13. avaScript entities start with _______ and end with _________. A. Semicolon, colon B. Semicolon, Ampersand C. Ampersand, colon D. Ampersand, semicolon Q14. Which of the following best describes JavaScript? A. a low-level programming language. B. a scripting language precompiled in the browser. C. a compiled scripting language. D. an object-oriented scripting language.

Q15. What is the correct JavaScript syntax to change the content of the HTML element below? This is a demonstration.

A. B. C. D.

document.getElementById("demo").innerHTML = "Hello World!"; document.getElementByName("p").innerHTML = "Hello World!"; document.getElement("p").innerHTML = "Hello World!"; #demo.innerHTML = "Hello World!";

Q16. How do you write "Hello World" in an alert box? A. B. C. D.

alert("Hello World"); msg("Hello World"); msgBox("Hello World"); alertBox("Hello World");

Q17. How do you create a function in JavaScript? A. B. C. D.

function myFunction() function = myFunction() function:myFunction() NONE

Q18. How do you round the number 7.25, to the nearest integer? A. B. C. D.

Math.round(7.25) round(7.25) rnd(7.25) Math.rnd(7.25)

Q19. What is the correct JavaScript syntax for opening a new window called "w2" ?

A. w2 = window.open("http://www.w3schools.com"); B. w2 = window.new("http://www.w3schools.com"); Q20. Which event occurs when the user clicks on an HTML element?

A. B. C. D.

onclick onmouseover onmouseclick onchange

Q21. avaScript Code is written inside file having extension __________. A. B. C. D.

.javascript .jvs .js .jsc

Q22. hy JavaScript is called as Lightweight Programming Language ? A. because JS is client side scripting B. because we can add programming functionality inside JS

C. because JS is available free of cost. D. because JS can provide programming functionality inside but up to certain extend. Q23. Select all the correct option(s). State the correct place of JS Code inside HTML A. B. C. D.

All of these Inside Head Inside Body Inside Single JavaScript File

Q24. JS code included inside head section is loaded before loading page. A. True B. False Q25. _____ attribute is used to specify the character encoding used in an external script file. A. B. C. D.

charset character None of These Type

Q26. Which was the first browser to support JavaScript ? A. B. C. D.

IE Mozilla Firefox Netscape Google Chrome

Q27 Which of the data type is not available in JS? A. B. C. D.

float var boolean undefined

Q28. Which company developed JavaScript?

A. Netscape B. Bell Labs C. Sun Microsystems D. IBM

Q29. JavaScript is designed for following purpose -

A. to style HTML pages B. to execute Queries related to databases on a server

C. to add interactivity to html pages D. All of the above

Q30. What are the types of Pop up boxes available in JavaScript?

A. Alert B. Prompt C. Confirm D. All of the above

Q31. How ++ works in Javascript? Find output of below Javascript code. var a = 1; document.write(a--); document.write(a);

A. 00 B. 01 C. 11 D. 10 Q32. Find output of below Javascript addition code document.write("1 plus 1 is " + 1 + 1);

A. 2 B. 1 plus 1 is 2 C. 1 plus 1 is 11 D. 1 plus 1 is 1 + 1 Q33. What if you use parseInt() to convert a string containing decimal value?

A. Throws Error B. It returns the decimal values in string form C. If returns only the integer portion of the number

D. None of the listed option

Q34. What is the output of below Javascript code? alert (typeof new Date() );

A. Throws Error B. object C. Displays Nothing D. Current Date

Q35. The _______ method of an Array object adds and/or removes elements from an array.

A. Reverse B. Shift C. Slice D. Splice

Q36. AJAX Stands for: A. Asynchronous Javascript and XML B. Abstract JSON and XML C. Another Java Abstraction for X-Windows D. Another Java and XML Library Q37. What makes Ajax unique? A. It works as a stand-alone Web-development tool. B. It works the same with all Web browsers. C. It uses C++ as its programming language. D. It makes data requests asynchronously. Q38. What does the XMLHttpRequest object accomplish in Ajax? A. It’s the programming language used to develop Ajax applications. B. It provides a means of exchanging structured data between the Web server and client.

C. It provides the ability to asynchronously exchange data between Web browsers and a Web server. D. It provides the ability to mark up and style the display of Web-page text. Q39. Ajax is a programming language. A. True B. False Q40. AJAX based on ______ . A. JavaScript and XML B. JavaScript and Java C. VBScript and XML D. JavaScript and HTTP requests Q41. Using AJAX we can made our web page. A. more interactive and faster B. easy to connect web page with server C. more dynamic Q42. What are the advantages of AJAX? A. B. C. D.

AJAX is a platform-independent technology It provides partial-page updates Improved performance All of the above

Q43. What are the disadvantages of AJAX? A. B. C. D.

Dependent on JavaScript Security issues Debugging is difficult All of the above

Q44. Which of the following technology is not used by Ajax? A. B. C. D.

JavaScript XMLHttpRequest Document Object Model Flash

Q45. AJAX comes in ____. A. 2003 B. 2005 C. 2004 D. 2006

Q46. AJAX made popular by A. Microsoft B. IBM C. Sun Microsystem D. Google Q47. __ is more robust and secure than __. A. POST, GET B. GET, POST C. Both A & B D. None of the above Q48. The ___ property defines a function to be executed when the readyState changes. A. onreadystatechange B. onreadystateup C. onreadystatedown D. None of the above Q49. What are the advantages of Ajax? A. Bandwidth utilization B. More interactive C. Speeder retrieval of data D. All of these Q50. __ get the response data as XML data. A. responseXML B. responseText C. responseString D. None of the above Q51. Which of these package contains classes and interfaces for networking? a) java.io b) java.util c) java.net d) java.network Q52. Which of these is a protocol for breaking and sending packets to an address across a network?

a) TCP/IP b) DNS c) Socket d) Proxy Server Q53. How many ports of TCP/IP are reserved for specific protocols? a) 10 b) 1024 c) 2048 d) 512 Q54. Which of these is a full form of DNS? a) Data Network Service b) Data Name Service c) Domain Network Service d) Domain Name Service Q55. Which of these class is used to encapsulate IP address and DNS? a) DatagramPacket b) URL c) InetAddress d) ContentHandle Q56. What will be the output of the following Java program?

import java.net.*; class networking { public static void main(String[] args) throws UnknownHostException { InetAddress obj1 = InetAddress.getByName("cisco.com"); System.out.print(obj1.getHostName()); } } a) cisco

b) cisco.com c) www.cisco.com d) none of the mentioned Q57. Which of these class is used to create servers that listen for either local or remote client programs? a) httpServer b) ServerSocket c) MimeHeader d) HttpResponse

Q58. Which of these is a standard for communicating multimedia content over email? a) http b) https c) Mime d) httpd Q59. What will be the output of the following Java program?

import java.net.*; class networking { public static void main(String[] args) throws MalformedURLException { URL obj = new URL("https://www.ABC.com/XYZ"); System.out.print(obj.toExternalForm()); } } a) sanfoundry b) sanfoundry.com c) www.sanfoundry.com d) https://www.ABC.com/XYZ Q60. What does URL stands for? a) Uniform Resource Locator b) Uniform Resource Latch c) Universal Resource Locator d) Universal Resource Latch

Q61. Which of these methods is used to know host of an URL? a) host() b) getHost() c) GetHost() d) gethost() Q62. hich of these data member of HttpResponse class is used to store the response from an http server? a) status b) address c) statusResponse d) statusCode Q63. Which of these is a bundle of information passed between machines? a) Mime b) Cache c) Datagrams d) DatagramSocket Q64. Which of these class is necessary to implement datagrams? a) DatagramPacket b) DatagramSocket c) All of the mentioned d) None of the mentioned Q65. Which of these method of DatagramPacket is used to obtain the byte array of data contained in a datagram? a) getData() b) getBytes() c) getArray() d) recieveBytes() Q66. Which of these method of DatagramPacket is used to find the port number? a) port() b) getPort() c) findPort() d) recievePort() Q67. Which of these class must be used to send a datagram packets over a connection? a) InetAdress b) DatagramPacket c) DatagramSocket d) All of the mentioned

Q68. Which API gets the SocketAddress (usually IP address + port number) of the remote host that this packet is being sent to or is coming from. a) getSocketAddress() b) getAddress() c) address() d) none of the mentioned Q69. Which constructor of DatagramSocket class is used to creates a datagram socket and binds it with the given Port Number? a. DatagramSocket(int port) b. DatagramSocket(int port, InetAddress address) c. DatagramSocket() d. None of the above Q70. The DatagramSocket and DatagramPacket classes are not used for connection-less socket programming. a. True b. False Q71. What does the java.net.InetAddress class represent? a. Socket b. IP Address c. Protocol d. MAC Address Q72. Which class is used to create servers that listen for either local client or remote client programs? A) ServerSockets B) httpServer C) httpResponse D) None of the above Q73. The client in socket programming must know which informations? A) IPaddress of Server B) Port number C) Both A & B D) None of the above Q74. Datagram is basically an information but there is no guarantee of its content, arrival or arrival time.

A) True B) False Q75. The DatagramSocket and DatagramPacket classes are not used for connection-less socket programming. A) True B) False Q76. Which of these is a protocol for breaking and sending packets to an address across a network?

a) TCIP/IP b) DNS c) Socket d) Proxy Server Q 77. Which of these class is used to create servers that listen for either local or remote client programs?

a) httpServer b) ServerSockets c) MimeHeader d) HttpResponse Q78. A port number in java has…size. A. B. C. D.

8-bit 16-bit 24-bit 48-bit

Q79. Datagram Socket class in Java is used to create Sockets in A. B. C. D.

UDP client UDP server A and B both None

Q80. In Java implementation of TCP, a client uses…….. a server uses………. A. ClientSocket object; ServerSocket object B. Socket object; ServerSocket objec C. Socket object; ServerSocket object and Socket object

D. None of the choices are correct....


Similar Free PDFs