You are on page 1of 20

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
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 executed
B. To starts a thread
C. To destroy a thread with lower priority of the current

D. To make a thread to complete all his activities before executing the


others

5 (HTML/JAVASCRIPT/CSS) In the following javascript code,


which is the execution order of the functions?
Function
Function
Function
Function
A();
C();
D();
B();
A
B
C
D

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

A;C;D;B;
A;C;B;D;A;C;B;B;
A;B;C;A;C;D;B;C;
A;C;B;D;A;C;B;C;
6

(HTML) What type of code is this sample?

Sample: <!--update this page in January-->


A. Javascript
B. a comment
C. VBScript
D. 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, deflate
B. A string array representing gzip, deflate
C. A string representing gzip
D. A string representing */*

8 (MISC) What is SOAP?


A. A protocol, based on XML, used to pass methods between local software
components
B. A specific version of XML used in the vectorial graphic
C. A protocol, based on XML, used to pass parameters between software
application based on remote computers
D. It doesnt 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. 0
B. 1
C. 100
D. 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
B. The div with id=box will have the top margin of 0 px, right margin of 20
px and left margin of 5px
C. The div with id=box will have top margin of 0 px, left and right margins
of 20 px and bottom margin of 5px
D. 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 private
B. Static methods cannot be overloaded
C. Private methods cannot be overloaded
D. An overloaded method cannot throw exceptions not checked in the base
class
15(JAVA) Consider the following definition:
1.
2.
3.
4.
5.
6.
7.
8.
9.

public class Outer {


public int a = 1;
private int b = 2;
public void method(final int c) {
int d = 3;
class Inner {
private void iMethod(int e) {
}

10.
}
11. }
12. }
Which variable cannot be referenced correctly at line 8?
A. a
B. b
C. c
D. d
16Which of the following statements about XML is false?
A. It has a limited number of tags
B. Its used to configure an application server trough web.xml
C. A xml file follows a tree structure
D. A xml file can be well formed but not valid

17(HTML/JAVASCRIPT/CSS) The result of the instruction


parseFloat(null) is:
A. false
B. NaN
C. undefined
D. 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)
19Which 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.

20Which is not a valid web page extension?


A. htm
B. htl
C. asp
D. php
21Which 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. Session
B. HttpSession
C. ContextSession
D. 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_BigOlLongStringWithMeaninglessName
B. $int
C. bytes
D. #dog
25When is the password needed in an application ?
A. Only during the authentications process
B. Always
C. Never, only the system (application server security) can manage the
authentication process
D. Never

26What is a DTD?
A. It is used to validate a XML Schema
B. It is used to validate a XPath file
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
document
D. A specific XML used to define the industrial standard for the Turing
machines
(HttpServletRequest req, HttpServletResponse res)
27Which of the following is not a keyword or reserved word in
Java?
A. then
B. goto
C. while
D. case
28Which sentence is false about Stateful Session Beans?
A. Is a bean thats 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 beans 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 stop
B. To run instructions only if no errors/exceptions happened
C. To run instructions also if errors/exceptions happened
D. 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 binary
4. byte c = 15; // 00001111 binary
5. b = (byte)(b ^ c);
6. System.out.println(b contains + b);
7. }

8. }
A. The output: b contains 10
B. The output: b contains 5
C. The output: b contains 250
D. The output: b contains 245
31(JAVA) Which of the following variables is defined by using the
keyword static?
A. Instance variable
B. Local variable
C. Class variable
D. 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 attributes
B. Session attributes
C. Context attributes
D. None of the above
33(HTML) What is the limit of tables you can nest within another
table?
A. four
B. unlimited
C. ten
D. two
34(JAVA) Which statement is true about this code?
1. class HasStatic
2. {
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.}
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 valid
B. The text of all the items of the list with id=menu will be displayed in
green
C. A drop-down selector will be used
D. 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 =8
B. x =15, a =6, b =7
C. x =13, a =7, b =8
D. x =13,

a =6,
b =7

37What 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")

38Given 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>
A. <servlet></servlet>
B. <web-app3></web-app3>
C. <web-app></web-app>
D. <welcome-file-list></welcome-file-list>
39Which 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.
2.
3.
4.
5.
6.
7.
8.
9.

byte b = 5;
char c = 5;
short s = 55;
int i = 555;
float f = 555.5f;
b = s;
i = c;
if (f > b)
f = i;

A. 6
B. 7
C. 8
D. 9
41(JAVA) A threads 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


threads 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.
D. At line 2, the thread will stop running. It will resume running some time
after 100 milliseconds have elapsed
42Assuming 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. 2314
B. 2341
C. 1234
D. 3412
43(HTML) What does IMG SRC mean in an image code?
A. image screen
B. image source
C. image file
D. 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 swap
C. allows you to add an alternative text description about an image to assist
when the image isn't viewable
D. 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.

46Which of the following design patterns is used to separate


developers from web designers roles?
A. MVC
B. Value Object
C. Data Access Object
D. MVC and Data Access Objects
47(HTML/JAVASCRIPT/CSS) How to be sure that an element will
not have other float elements on his left?
A. Declaring it clear:left
B. Declaring it float:none
C. Declaring it display:inline
D. 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.
49Which Internet transfer protocol means you're working
through a secure web connection?
A. https
B. ftp
C. http

D. 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;
System.out.println(i + ten);
A. 19 followed by 20
B. 19 followed by 11
C. Error: Can't convert java lang Integer
D. 10 followed by 1
51Your 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. MVC
B. Value Object
C. Data Access Object
D. 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 = 0
B. i = 0 j = 1
C. i = 0 j = 2
D. i = 1 j = 0

53(THYMELEAF) What types of templates cannot Thymeleaf process


(using the standard template parser)?
A XML
B XHTML
C HTML5
D JSP

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 Mark
D It will throw an exception

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


A
B
C
D

${#lists.size(myList)}
${#list.size(myList)}
${#lists.length(myList)}
${#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
B
C
D

action-state
object-state
decision-state
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" />
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.Comparable
B com.mycompany.myapp.myBean has to implements java.lang.Runnable
C com.mycompany.myapp.myBean has to implements java.io.Flushable
D 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 immediate
B architecture
C propagation
D 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.
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 @Provides
B @Component @Instantiate and @Requires
C @Component @ServiceProperty and @Requires
D @Instantiate @ServiceProperty and @Requires

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


1.
2.
3.
4.
5.
6.
7.
8.

require([
"dijit/Calendar",
"dojo/date",
"dojo/domReady!"
], function(Calendar, date){
new Calendar({
value: new Date(),
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();
11. });
1.
2.
3.
4.
5.
6.

require([
"dojo/parser",
"dojo/date",
"dijit/Calendar"
]);
<div id="mycal" data-dojo-type="dijit/Calendar" value="2009-08-07" data-dojoprops="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
declaratively
D 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.
4.
5.
6.

var handle = topic.subscribe("write", function(e){


dom.byId("output").innerHTML =e.msg;
handle.remove();
});

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 world
B Nothing Yet...
C write
D None of the above is correct

67(DOJO) Describe the Event System in Dojo


A Dojo does not admit any event system management
B Any DOM object can be connected to any function dojo.event.connect(id, onClick,
listenerObj, handleOnClick)
C The event system is managed by native javascript
D 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 requests
C You can issue Ajax request only by using a Xmlhttprequest object
D None of the above is correct

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


A dojo.html
B dojo.system
C dojo.keyboard
D dojo.controller

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


1.
2.
3.
4.
5.
6.

var myObject={
"developer":{
"name":"Bob",
"age":"15"
}
}

What is the correct way to get Name value in Javascript?


A myObject.developer.name
B myObject.name
C 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-model
B ng-app
C ng-controller
D None of the above

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.bootstrap
B angular.element
C angular.copy
D 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 variable
C Both of the above
D 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 above
D 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.

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


A jcr:created
B jcr:body
C jcr:title
D jcr:description

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


false ?
A They cannot contain other components
B They are re-usable
C They have no hidden configuration files
D They can use widgets

You might also like