23
Surname: Name: Date: KNOWLEDGE ASSESSMENT 1. (HTML/JAVASCRIPT/CSS)Which is the correct code to apply for bold text? A.. <b>This is bold text.</b> B. (b)This is bold text.(/b) C. <bold>This is bold text.</bold> D. <b>This is bold text.<b> 2. (SERVLET/JSP) Which of the following HTTP types contains the defined protocol, status code, method type, header information, and body? A. HTTP request B. HTTP response C. HTTP protocol D. None of the above 3. (JAVA) If all three top-level elements occur in a source file, they must appear in which order? A. Imports, package declarations, classes B. Classes, imports, package declarations C. Package declarations must come first; order for imports and class definitions is not significant D. Package declarations, imports, classes

HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

Embed Size (px)

DESCRIPTION

jhjg

Citation preview

Page 1: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

Surname:Name: Date:

KNOWLEDGE ASSESSMENT

1. (HTML/JAVASCRIPT/CSS)Which is the correct code to apply for bold text?

A.. <b>This is bold text.</b>B. (b)This is bold text.(/b)C. <bold>This is bold text.</bold>D. <b>This is bold text.<b>

2. (SERVLET/JSP) Which of the following HTTP types contains the defined protocol, status code, method type, header information, and body?

A. HTTP requestB. HTTP responseC. HTTP protocolD. None of the above

3. (JAVA) If all three top-level elements occur in a source file, they must appear in which order?

A. Imports, package declarations, classesB. Classes, imports, package declarationsC. Package declarations must come first; order for imports and class definitions is not significantD. Package declarations, imports, classes

4. (JAVA) What is the use of the method thread.sleep() ?

A. To interrupt a thread for a limited period of time, allowing the threads with lower priority to be executedB. To starts a threadC. To destroy a thread with lower priority of the currentD. To make a thread to complete all his activities before executing the others

Page 2: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

5. (HTML/JAVASCRIPT/CSS) In the following javascript code, which is the execution order of the functions?

Function A() {}Function B() {var b = C.caller; alert(b);}Function C() {var c = B.caller; B();}Function D() {A();C();}A();C();D();B();

A. A;C;D;B;B. A;C;B;D;A;C;B;B;C. A;B;C;A;C;D;B;C;D. A;C;B;D;A;C;B;C;

6. (HTML) What type of code is this sample?

Sample: <!--update this page in January--> A. JavascriptB. a commentC. VBScriptD. a hyperlink

7. (SERVLET/JSP) Given the following request, what result would you expect from the following method call?

GET /Register/index.html HTTP/1.0 Date: Fri, 26 Oct 2001 17:12:10 GMT User-Agent: Mozilla/4.75[en](Windows NT 5.0; U)Accept: image/gif, image/x-xbitmap, image/jpeg, */* Host: educationaledge.net Accept-Encoding: gzip, deflate------------------------------- req.getHeaders(“Accept-Encoding”);

A. A string representing gzip, deflateB. A string array representing gzip, deflateC. A string representing gzipD. A string representing */*

Page 3: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

8. (MISC) What is SOAP?

A. A protocol, based on XML, used to pass methods between local software componentsB. A specific version of XML used in the vectorial graphicC. A protocol, based on XML, used to pass parameters between software application based on remote computersD. It doesn’t exist

9. (JAVA) Consider the following application:

1. class Q6 {2. public static void main(String args[]) {3. Holder h = new Holder();4. h.held = 100;5. h.bump(h);6. System.out.println(h.held);7. }8. }9.10. class Holder {11. public int held;12. public void bump(Holder theHolder) {13. theHolder.held++; }14. }15. }What value is printed out at line 6?

A. 0B. 1C. 100D. 101

10. (JAVA) How can you force garbage collection of an object?

A. Garbage collection cannot be forced.B. Call System.gc().C. Call Runtime.gc().D. Set all references to the object to new values (null, for example).

11. (HTML/JAVASCRIPT/CSS) Using the following CSS rule: div#box{margin: 0 20px 5px}:

A. The div with id=”box” will have left and right margins of 5px and the top margin of 20px

Page 4: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

B. The div with id=”box” will have the top margin of 0 px, right margin of 20 px and left margin of 5pxC. The div with id=”box” will have top margin of 0 px, left and right margins of 20 px and bottom margin of 5pxD. The div with id=”box” will have botton margin of 20 px and left and right margins of 5 px

12. (JAVA)What is a inner class?

A. A class with a private constructor B. A class not visible from outside C. A class visible only by classes contained in the same package D. A class defined inside another class

13. (SERVLET/JSP) Which of the following methods is not available for an HttpSession object?

A. removeAttribute(String name)B. setAttribute(String name, Object value)C. getAttribute(String name)D. log(String msg)

14. (JAVA) Which of the following statements is true?

A. Methods cannot be overriden when declared privateB. Static methods cannot be overloadedC. Private methods cannot be overloadedD. An overloaded method cannot throw exceptions not checked in the base class

15. (JAVA) Consider the following definition:

1. public class Outer {2. public int a = 1;3. private int b = 2;4. public void method(final int c) {5. int d = 3;6. class Inner {7. private void iMethod(int e) {8.9. }10. }11. }12. }Which variable cannot be referenced correctly at line 8?

A. a

Page 5: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

B. bC. cD. d

16. Which of the following statements about XML is false?

A. It has a limited number of tagsB. It’s used to configure an application server trough web.xmlC. A xml file follows a tree structureD. A xml file can be well formed but not valid

17. (HTML/JAVASCRIPT/CSS) The result of the instruction parseFloat(“null”) is:

A. falseB. NaNC. undefinedD. 0

18. (JAVA) Which of the following signature is valid for the main() method entry point of an application?

A. public static void main()B. public static void main(String arg[])C. public void main(String [] arg)D. public static int main(String [] arg)

19. Which of the following statements is false?

A. Enterprise JavaBeans defines how server-side components are written and provides a standard contract between components and the application servers that manage them.B. Java Remote Method Invocation (RMI) allows for interprocess communication and provides other communication-related services.C. Java Database Connectivity (JDBC) allows for asynchronous distributed object communications.D. Java Naming and Directory Interface (JNDI) identifies the locations of components or other resources across the network.

20. Which is not a valid web page extension?

A. htmB. htlC. aspD. php

Page 6: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

21. Which of the following statements is used to retrieve a session object across multiple requests to the same or different servlets within the same WebApp?

A. request.getContext().getSession();B. response.getContext().getSession();C. request.getSession();D. response.getSession();

22. (SERVLET/JSP) The setAttribute(…) method for session objects is located in which of the following classes or interfaces?

A. SessionB. HttpSessionC. ContextSessionD. None of the above

23. (HTML) Which one is the proper opening/closing code tags for a numbered list?

A. <nl></nl>B. <ol></ol>C. <ul></ul>D. <li></li>

24. (JAVA) Choose the invalid identifier from those listed here.

A. 3_BigOlLongStringWithMeaninglessNameB. $intC. bytesD. #dog

25. When is the password needed in an application ?

A. Only during the authentication’s processB. AlwaysC. Never, only the system (application server security) can manage the authentication processD. Never

26. What is a DTD?

A. It is used to validate a XML SchemaB. It is used to validate a XPath file

Page 7: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

C. It is the acronym of Definition Type Document, and it is one of the two basic set of rules used to define the structure of a well-formed XML documentD. A specific XML used to define the industrial standard for the Turing machines (HttpServletRequest req, HttpServletResponse res)

27. Which of the following is not a keyword or reserved word in Java?

A. thenB. gotoC. whileD. case

28. Which sentence is false about Stateful Session Beans?

A. Is a bean that’s designed to service business processes that span multiple method requests or transactions.B. Does not retain any state from previousrequests.C. Retain state on behalf of an individual client.D. If a stateful session bean’s state is changed during a method invocation, that same state will be available to that same client upon the following invocation.

29. (HTML/JAVASCRIPT/CSS) What is the exact scope of finally{…} in the errors management?

A. To force the script stopB. To run instructions only if no errors/exceptions happenedC. To run instructions also if errors/exceptions happenedD. To identify the istructions that generated an error/exception

30. (JAVA) What results from running the following code?

1. public class Xor {2. public static void main(String args[]) {3. byte b = 10; // 00001010 binary4. byte c = 15; // 00001111 binary5. b = (byte)(b ^ c);6. System.out.println(“b contains ” + b);7. }8. }

A. The output: b contains 10B. The output: b contains 5C. The output: b contains 250

Page 8: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

D. The output: b contains 245

31. (JAVA) Which of the following variables is defined by using the keyword static?

A. Instance variableB. Local variableC. Class variableD. Request attribute

32. (SERVLET/JSP) Which of the following attributes is associated to a ServletRequest object using the setAttribute(String key, Object obj) method?

A. Request attributesB. Session attributesC. Context attributesD. None of the above

33. (HTML) What is the limit of tables you can nest within another table?

A. fourB. unlimitedC. tenD. two

34. (JAVA) Which statement is true about this code?

1. class HasStatic2. {3. private static int x = 100;4.5. public static void main(String args[])6. { 7. HasStatic hs1 = new HasStatic();8. hs1.x++;9. HasStatic hs2 = new HasStatic();10. hs2.x++;11. hs1 = new HasStatic();12. hs1.x++;13. HasStatic.x++;14. System.out.println(“x = “ + x);15. }16.}

Page 9: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

A. Line 8 will not compile, because it is a static reference to a private variable.B. Line 13 will not compile, because it is a static reference to a private variable.C. The program compiles, and the output is x = 102.D. The program compiles, and the output is x = 104.

35. (HTML/JAVASCRIPT/CSS) With the following rule, which statement is correct?

Ul#menu>li{color: green}

A. The rule is not validB. The text of all the items of the list with id=”menu” will be displayed in greenC. A drop-down selector will be usedD. The text of all the items that are direct childs of the list with id=”menu” will be displayed in green

36. (JAVA) After execution of the following code fragment, what are the values of the variables x, a, and b?

1. int x, a = 6, b = 7;2. x = a++ + b++;

A. x =15, a =7, b =8B. x =15, a =6, b =7C. x =13, a =7, b =8D. x =13, a =6, b =7

37. What is the correct JavaScript syntax for opening a new window called "window2" ?

A. new("http://www.w3schools.com","window2") B. open.new("http://www.w3schools.com","window2") C. new.window("http://www.w3schools.com","window2") D. window.open("http://www.w3schools.com","window2")

38. Given the following XML statement, which of the following tags best describes the remaining portion of the web.xml file?

<!DOCTYPE web-app3 PUBLIC “-//SUM Microsystems, Inc.//DTD Web Application 2.3//EN” “http://java.sun.com/j2ee/dtds/web-app_2_3.dtd”>

Page 10: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

A. <servlet></servlet>B. <web-app3></web-app3>C. <web-app></web-app>D. <welcome-file-list></welcome-file-list>

39. Which of the following “for” cycles is correct?

A. for(i=0;i<10;i++;)B. for(i=0,i<10,i++)C. for(i=0;i<10;i++)D. None of the above

40. (JAVA) Which one line in the following code will not compile?

1. byte b = 5;2. char c = ‘5’;3. short s = 55;4. int i = 555;5. float f = 555.5f;6. b = s;7. i = c;8. if (f > b)9. f = i;

A. 6B. 7C. 8D. 9

41. (JAVA) A thread’s run() method includes the following lines:

1. try {2. sleep(100);3. }catch (InterruptedException e) { }Assuming the thread is not interrupted, which one of the following statements is correct?

A. The code will not compile, because exceptions cannot be caught in a thread’s run() method.B. At line 2, the thread will stop running. Execution will resume in, at most, 100 milliseconds.C. At line 2, the thread will stop running. It will resume running in exactly 100 milliseconds.

Page 11: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

D. At line 2, the thread will stop running. It will resume running some time after 100 milliseconds have elapsed

42. Assuming these phases: 1 - USER TEST (end-user test), 2 -UNIT TEST (test of a single component), 3 - SYSTEM TEST (test of the entire application) and 4 - INTEGRATION TEST (test between different application): what is the logical priority of these phases ?

A. 2314B. 2341C. 1234D. 3412

43. (HTML) What does IMG SRC mean in an image code?

A. image screenB. image sourceC. image fileD. image type

44. (HTML) What does the ALT code do?

A. allows you to add a comment in your code B. allows you to use an alternative image for a picture swapC. allows you to add an alternative text description about an image to assist when the image isn't viewableD. allows you to add an alternative hyperlink

45. (JAVA) Consider the following line of code:

int[] x = new int[25]; After execution, which statement is true?

A. x[24] is 0.B. x[24] is undefined.C. x[25] is 0.D. x[0]is null.

46. Which of the following design patterns is used to separate developers from web designers’ roles?

A. MVCB. Value ObjectC. Data Access ObjectD. MVC and Data Access Objects

Page 12: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

47. (HTML/JAVASCRIPT/CSS) How to be sure that an element will not have other float elements on his left?

A. Declaring it clear:leftB. Declaring it float:noneC. Declaring it display:inlineD. Declaring it display:block

48. (JAVA) Consider the following class:

1. class Cruncher {2. void crunch(int i) {3. System.out.println(“int version”);4. }5. void crunch(String s) {6. System.out.println(“String version”);7. }8.9. public static void main(String args[]) {10. Cruncher crun = new Cruncher();11. char ch = ‘p’;12. crun.crunch(ch);13. }14. }Which of the following statements is true?

A. Line 5 will not compile, because void methods cannot be overridden.B. Line 12 will not compile, because no version of crunch() takes a char argument.C. The code will compile and produce the following output: int version.D. The code will compile and produce the following output: String version.

49. Which Internet transfer protocol means you're working through a secure web connection?

A. httpsB. ftpC. httpD. Telnet

50. (JAVA) What will happen if you attempt to compile and run the following code?

Integer ten=new Integer(10);Long nine=new Long (9);System.out.println(ten + nine);int i=1;

Page 13: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

System.out.println(i + ten);

A. 19 followed by 20B. 19 followed by 11C. Error: Can't convert java lang IntegerD. 10 followed by 1

51. Your current application needs to be extensible and flexible to changes in the data-source implementation. Which of the following design patterns will you implement to ensure meeting these requirements?

A. MVCB. Value ObjectC. Data Access ObjectD. Facade

52. (JAVA) Consider the following code:

1. for (int i = 0; i < 2; i++) {2. for (int j = 0; j < 3; j++) {3. If (i == j) {4. continue;5. }6. System.out.println(“i = “ + i + “ j = “ + j);7. }8. }

Which line will not be part of the output?

A. i = 0 j = 0B. i = 0 j = 1C. i = 0 j = 2D. i = 1 j = 0

53. (THYMELEAF) What types of templates cannot Thymeleaf process (using the standard template parser)?

A XMLB XHTMLC HTML5D JSP

Page 14: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

54. (THYMELEAF) If home.welcome is equal to "Hello Mark" , what will this expression write on an HTML page ?

<p th:text="#{home.welcome}"> Welcome to our grocery store!</p>

A Hello Mark Welcome to our grocery store!B Hello MarkWelcome to our grocery store!C Hello MarkD It will throw an exception

55. (THYMELEAF) How do you get a List size ?

A  ${#lists.size(myList)}B  ${#list.size(myList)}C  ${#lists.length(myList)}D  ${#list.length(myList)}

56. (THYMELEAF) To iterate a List which of the following statements is correct?

A th:each="elem : ${myList}"B th:each="${myList}"C th:for="elem : ${myList}"D None of the above is correct.

57. (SPRING WEB FLOW) Which of the following states does not exist ?

A  action-stateB  object-stateC  decision-stateD  subflow-state

58. (SPRING WEB FLOW) Which is the correct syntax to set a transition to some other flow state ?

A <transition on="*" to="someOtherState" />

Page 15: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

B <goto on="*" to="someOtherState" />C <transition if="*" then="someOtherState" />D None of the above is correct.

59. (SPRING WEB FLOW) Given the following code what is the prerequisite to make it works?

<var name="myVar" class="com.mycompany.myapp.myBean"/>

A com.mycompany.myapp.myBean has to implements java.lang.ComparableB com.mycompany.myapp.myBean has to implements java.lang.RunnableC com.mycompany.myapp.myBean has to implements java.io.FlushableD com.mycompany.myapp.myBean has to implements java.io.Serializable

60. (SPRING WEB FLOW) Which line of code would you use to compute an expression within your flow ?

A <evaluate expression="bookingService.findHotels(searchCriteria)" result="flowScope.hotels" />B <compute expression="bookingService.findHotels(searchCriteria)" result="flowScope.hotels" />C <calculate expression="bookingService.findHotels(searchCriteria)" result="flowScope.hotels" />D None of the above is correct.

61. (IPOJO) Which of the following attributes is mandatory in a @Component annotation?

A immediateB architectureC propagationD None of the above is correct.

62. (IPOJO) You created a component using the @Component annotation but you forgot to set its name attribute. Now this component :

A Will not work.

Page 16: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

B Will work and the component will be registered with a random generated name (e.g. MyController_01).C Will work and the component will be registered with its class name (e.g. MyController).D Will work and the component will be registered with its complete class name (e.g. com.mycompany.myapp.MyController) .

63. (IPOJO) What is the goal of the @Provides annotation ?

A It's to expose the controller as an OSGi service.B It's to inject a service in a field or in a constructor.C It's to enable service management.D It's to replace the blueprint xml configuration file.

64. (IPOJO) To create a MVC Controller you will need to use three annotations

A @Component @Instantiate and @ProvidesB @Component @Instantiate and @RequiresC @Component @ServiceProperty and @RequiresD @Instantiate @ServiceProperty and @Requires        

65. (DOJO) Which one of the following fragments is a dojo widget ?

1. require([2. "dijit/Calendar",3. "dojo/date",4. "dojo/domReady!"5. ], function(Calendar, date){6. new Calendar({7. value: new Date(),8. isDisabledDate: function(d){

a. var d = new Date(d); d.setHours(0, 0, 0, 0);b. var today = new Date(); today.setHours(0, 0, 0, 0);c. return Math.abs(date.difference(d, today, "week")) > 0;

9. }10. }, "mycal").startup();

Page 17: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

11. });

1. require([2. "dojo/parser",3. "dojo/date",4. "dijit/Calendar"5. ]);6. <div id="mycal" data-dojo-type="dijit/Calendar" value="2009-08-07" data-dojo-

props="isDisabledDate:dojo.date.locale.isWeekend"></div>A The first fragment is a dojo widget but the second it is not B The second fragment is a dojo widget but the first it is not C Both of them are a dojo widget where the first is instantiated programmatically and the second declarativelyD None of the above is correct

66. (DOJO) Given the following fragment of Dojo code:

1. require(["dojo/topic", "dojo/dom", "dojo/on", "dojo/domReady!"],2. function(topic, dom, on){

3. var handle = topic.subscribe("write", function(e){4. dom.byId("output").innerHTML =e.msg;5. handle.remove();6. });

7. on(dom.byId("publish"), "click", function(){8. topic.publish("write", { msg: "hello world" });9. });

10. });11. <button type="button" id="publish">Publish "some/topic"</button>12. <div id="output">Nothing Yet...</div>

What is the message will be displayed when the button is clicked? A hello worldB Nothing Yet...C writeD None of the above is correct

67. (DOJO) Describe the Event System in Dojo

A Dojo does not admit any event system managementB Any DOM object can be connected to any function dojo.event.connect(”id”, ”onClick”, listenerObj, ”handleOnClick”)

Page 18: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

C The event system is managed by native javascriptD None of the above;

68. (DOJO) Relation between AJAX and Dojo?

A It is possible to make AJAX requests with Dojo B Dojo does not provide any API to support Ajax requestsC You can issue Ajax request only by using a Xmlhttprequest objectD None of the above is correct

69. (DOJO) Which one is a Dojo Toolkit Library ?

A dojo.htmlB dojo.system C dojo.keyboardD dojo.controller

70. (JSON) Given the following fragment of Json code:

1. var myObject={2. "developer":{3. "name":"Bob",4. "age":"15"5. }6. }

What is the correct way to get Name value in Javascript?A myObject.developer.nameB myObject.nameC myObject["name"]D None of the above is correct

71. (ANGULAR) Which of the following directives is used to initialize an angular app?

A ng-modelB ng-appC ng-controllerD None of the above

Page 19: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

72. (ANGULAR) What are various possible prefixes such as 'ng-' using which Angular directives (for example, ng-app) can be defined?

A 'ng-', 'data-ng-', 'ng:'B 'ng-'C 'ng-', 'data-ng-', 'ng:', 'x-ng-'D 'ng-', 'data-ng-','x-ng-'

73. (ANGULAR) What angular function is used to manually start up an angular application?

A angular.bootstrapB angular.elementC angular.copyD None of the above

74. (ANGULAR) At framework level, how does Angular retrieve the matching elements for processing?

A Makes use of jqLite(element) function.B If jQuery is used, jQuery(element) is used by way of assigning jQuery to jqLite variableC Both of the aboveD None of the above

75. (ANGULAR) What are various possible ways in which angular application can be initialized?

A On an element, one could either put simply the attribute such as (ng-app, data-ng-app, ng:app, x-ng-app) or put the named attribute such as (ng-app='demoApp')B Put the named attribute such as (ng-instance='executeApp')C Both of the aboveD None of the above

76. (CQ5) What is CRX ?

A It's a data storage system designed for content-centric applications.B It's an user interface that enables you to perform standard development tasks in the browser (e.g. create a project or create and edit files folders, templates...)C It's a CQ5 component which allows you to export a page as a complete web page including images, .js and .css files.D It's a CQ5 component which provides you a powerful website optimization tool.

Page 20: HTML JS CSS Java Dojo Angular Ipojo Spring Json Thymleaf CQ5 1.0

77. (CQ5) Which of the following template properties does not exist ?

A jcr:createdB jcr:bodyC jcr:titleD jcr:description

78. (CQ5) Which of the following assertions about Components is false ?

A They cannot contain other componentsB They are re-usableC They have no hidden configuration filesD They can use widgets