0% found this document useful (0 votes)
29 views

Final FSD Java Assessment

Uploaded by

Tejas Xd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Final FSD Java Assessment

Uploaded by

Tejas Xd
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Question No: 90

Multiple Choice (There may be more than 1 correct answer)

Which of the following classers are scanned for component scanning in spring MVC application

Options:-

a)The classes with @controller annotation placed on the top of the class

b) The classes with @Repository annotation placed on the top of the class

c) The classes with @Service annotation placed on the top of the class

d)All from the options

Question No: 89

Multiple Choice (There may be more than 1 correct answer)

Which of the following is true for the generation strategy SEQUENCE for primary key generation?

Options:-

a)Multiple tables can use the same sequence generator

b)It uses an auto-incremented column to produce a sequence of primary keys

c)It uses a shared table where sequential primary keys are stored

d)It uses a database sequence generator to generate primary keys

Question No: 88

Multiple Choice (Select 1 out of 4 options, for the question below.)

In hibernate, which methods hits the database always?

Options:-

a)loadDatabase()

b)load()

c) get()

d)getDatabase()

Question No: 87

Multiple Choice (Select 1 out of 4 options, for the question below.)


Which of the following is not involved in constituting the View Page which is rendered back as a
response in Spring MVC Application

Options:-

a)<property name="prefix"> which is the part of <bean id="ViewResolver" class=" ">

b)<property name="suffix"> which is the part of <bean id="ViewResolver" class="

c)The String type parameter to the constructor of ModelAndView Class

d)The Annotation @ViewName

Question No: 86

Multiple Choice (Select 1 out of 4 options, for the question below.

Which of the following is a valid arrow function?

Options:-

a)let sum = (x: number, y: number) => x + y;

b)let sum(): (x: number, y: number):number => x + y;

c)let sum = (x: number, y: number) => return x + y;

d)let sum:(x: number, y: number) => x+y;

Question No: 85

Identify the different modes of autowiring?

Options:-

A.) no, byName, by Type, byConstructor

B. )no, byName, byType, constructor, autocorrect

C. )byName, byContent, setter, autodetect

D. )no, byName, byType, constructor, autodetect

Question No: 84

Multiple Choice (There may be more than 1 correct answer)

Which of the following are valid built-in pipes in Angular?

Options:-

A. )JsonPipe

B.) KeyValuePipe
C. )DatePipe

D.) Observable

Question No. 83

Multiple Choice (Select 1 out of 4 options for the question below)

What implementation of Iterator can traverse a collection in forward direction only?

Options:-

A. )Iterator

B. )ListIterator

C. )Setiterator

D.) Maplterator

Question No: 82

Multiple Choice (Select 1 out of 4 options, for the question below

Which of these classes are the direct subclasses of the Throwab

Options:-

A.) RuntimeException and Error class

B.) Exception and Virtual MachineError class

C.) Error and Exception class

D.) IOException and VirtualMachineError class

Question No: 81

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which collection class allows you to grow or shrink its size and provides index access to its element
but whose methods are not sy

Options:-

A. )HashSet

B. )TreeSet
C. )ArrayList

D. )Vector

Question No. 80

Multiple Choice (There may be more than 1 correct answer)

What is the output of the following code?

1: interface Has Tail { int getTailLength(); }

2: abstract class Puma implements HasTail {

3: protected int getTailLength() { return 4;}

4:}

5: public class Cougar extends Puma {

6: public static void main(String[] args) {

7: Puma puma = new Puma();

8: System.out.println(puma.getTailLength());

9:}

10:

11: public int getTailLength(int length) {return 2;)

12:}

Options:-

A. )2

B.) 4

C. )The code will not compile because of line 5.

D. )The code will not compile because of line 7.

E. )The code will not compile because of line 11


F. )The output cannot be determined from the code provided

Question No: 79

Multiple Choice (Select 1 out of 4 options, for the question below.)

If servlet name in web.xml is dispatcherservlet then as per naming convention, name of bean xml file
should be

Options:-

A. )dispatcherservlet-servlet.xml

B. )dispatcher-servlet-servlet.xml

C. )dispatcher-servlet.xml

D. )dispatcherservlet.xml

Question No: 78

Multiple Choice (Select 1 out of 4 options, for the question below.)

in object-oriented programming, composition relates to

Options:-

A.) The use of data hiding to achieve polymorphic behavior

B. )The organization of components interacting not to achieve a coherent common behavior

C. )A class that references one or more objects of other classes in instance variables

D. )The use of consistent coding conventions.

Question No: 77

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which one of the following is the proper way to include java.util package in your jsp page?

Options:-

A.) <page:import package="java.util">

B. )<%= import java.util. %>

C. )<%@ page import="java.util.*" %>

D. )<%@ import class="java.util."" %>


Question No: 76

Multiple Choice (Select 1 out of 4 options, for the question below.)

What is the output of the current code segment ?

<c:forTokens items="a,b,c,d,e" delims="." begin="0" end="4" step="2" var="alphaber"> <cout


value="${alphabet}"/> </c:forTokens>

Options:-

A.) a,c,e

B. )b,d

C. )a,b,c

D. )c,d,e

Question No. 75

Multiple Choice (Select 1 out of 4 options, for the question below.)

Choose an option which is correct about the <c:url> tag.

Options:-

A. )The <c:url> tag automatically performs URL rewriting when necessary

B.) The <c:url> tag formats a URL into a string and stores it into the variable

C. )The <c:url> tag does not used for unl encoding

D. )The <c:url> tag performs the URL rewriting manually


Question No: 74

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which interface provides details about table name and column name in jdbc package?

Options:-

A). ResultSet

B.) ResultSetMetaData

C.)DatabaseMetaData

D. )Statement

Question No: 73

Multiple Choice (Select 1 out of 4 options, for the question below.)

Choose the correct syntax used bind mouse click event in Angular ?

Options:-

A.) (click)="myMethod()"

B. )[click]="myMethod()"

C. )click="(myMethod)"

D. )(onClick)="myMethod()"

Question No: 72
Multiple Choice (Select 1 out of 4 options, for the question below.)

Which of the below are the types of advice in spring AOP?

Options:-

A .) Before, After, After-Returning, After-Throwing, Around

B.) Where, After-Returning, After-Throwing. Around

C.) Then, After, After-Returning. After-Throwing, Around

D.) When, After, After-Returning Around

Question No: 71

what is the output of the following code snippet?

class ClassA

public static void main(String[] args){

System.out.print("a");

try {

System out print("b"),

throw new IllegalArgumentException(), } catch (RuntimeException e) {

System out print("e")

} finally {

System.out.print("d"),"

System.out.print("e");

Optons:-

A .) abe

B. )abce

C. )abde

D . )abcde

E. )The code does not compile

F. )An uncaught exception is thrown

Question No: 70
Multiple Choice (Select 1 out of 4 options, for the question below.)

What will be the output of the following code snippet?

<% page language="""java"""%>

<html>

<head></head>

<body>

<%java.util.Date now=new java.util.Date();%>

<H1><%= now.getHours() %> <%=now.getMinutes()%> <%= now.getSeconds()%></H1>

</body>

</html>

Options:-

A.) It will display the date as mm:ddyy

B. )It will display the date and time

C. )It will display time as hh/mm/ss

D. )It will display the current time as hh:mm:ss

Question No: 69

Multiple Choice (Select 1 out of 4 options, for the question below)

Which method of TestServlet will get executed on clicking submit button of the following code?

<form action="/TestServlet"> <input type="text" name="name">

<input type="submit" value="Submit">

</form>

Options:-

A.) doPut()

B. )doGet()

C. )doPost()

D. )doOption()

Question No: 68
Multiple Choice (Select 1 out of 4 options, for the question below.)

Which one of the following lines of code, in the doPost() method of a servlet, uses the URL rewriting
approach to maintaining sessions?

Options:-

A.) useURLRewriting0

B. )out println(response.rewrite("<a href='/servlet/XServlet>Click here</a>"));

C. )out.println("<a href=" "+response.encodeURL("/servlet/XServlet")+">Click here</a>"));

D. )out.println("<a href="+request encodeURL("/servlet/XServlet")+7">Click here</a>"));

Question No: 67

Multiple Choice (Select 1 out of 4 options, for the question below.)

Consider the following servlet code segment:

HttpSession session = request.getSession(true);

session.setAttribute("name", "Mphasis");

System.out.println(session.getAttribute("name");

session.invalidate(0);

if (session.isNew()) {

} else {

System.out.println(session.isNew());

What is the output of the above code segment?

Options:-

A. )Displays "Mphasis" always

B.) Displays "false" always

C. )Throws exception

D. )Depends on whether the session is newly created or not.

Question No: 66
Multiple Choice (There may be more than 1 correct answer)

Which of the following are valid HTML5 input types?

Options:-

A. )colors

B. )time

C . )datetime

D )number

Question No: 65

Multiple Choice (Select 1 out of 4 options, for the question below.)

What does the below snippet result in?

function aaa() {

return

test: 1

}:

alert(typeof aaa());

Options:-

A.) Function

B. )Number

C. )Object

D. )undefined

Question No: 64

Multiple Choice (Select 1 out of 4 options for the question below.)

Which is the root tag of hbm.xml file?

Options:-

A.) class-mapping

B.) class-config

C. )hibernate-config

D. )hibernate-mapping

Question No: 63
Multiple Choice ( Select 1 out of 4 options, for the question below.)

Which of the following is not a valid state of object in Hibernate?

Options:-

A.) Persistent State

B. )Transient State

C.) Attached State

D.) Detached State

Question No: 62

Multiple Choice (Select 1 out of 4 options, for the question below.)

Identify the correct statement about hibernate annotations.

Options:- (both are correct answers ,choice is yours)

A. )All the metadata is clubbed into the POJO java file along with the code this helps the user to
understand the table structure and POJO sin the development.

B. )Hibernate Annotations is the powerful way to provide the metadata for the Object and Relational
Table mapping

C. )The hibernate annotations is not powerful way for the relational table mapping.

D. )The annotations does not provide the metadata for the object.

Question No: 61

Multiple Choice (Select 1 out of 4 options, for the question below.)

Choose an option code that is used in the servlets to get an attribute from the HTTP Session object.

Options:-

A.)session.alterAttribute(String name)

B.)session.setAttribute(String name)

C.)session.getAttribute(String name)

D.) session.updateAttribute(String name)

Question No: 60

Multiple Choice (Select 1 out of 4 options, for the question below.

Which of the following Statement interface method can be used for executing DML statements"

Options:-
A. )executeDDL()

B.) executeUpdate()

C. )executeQuery()

D.) executeResult()

\Question No:59

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which tag is used to enable annotation support in Spring?

Options:-

A. )<annotation-config /> to bean configuration.

B. )<annotation-context:config /> to bean configuration.

C. )<context:configuration>

D.) <context:annotation-config/> to bean configuration.

Question No:58

Multiple Choice (Select 1 out of 4 options, for the question below.)

You have built a collection of custom tags for your web application. The TLD file is located in the file:
/WEB-INF/my Tags.xml. You refer to these tags in your JSPS using the symbolic name:my Tags.
Which deployment descriptor element must you use to make this link between the symbolic name
and the TLD file name?

Options:-

a)<taglib>

<name>my Tags</name>

<location>/WEB-INF/my Tags.xml</location>

</taglib>

b)<tags>

<name>my Tags</name>

<location>/WEB-INF/myTags.xml</location>
</tags>

c)<tags>

<tags-uri>my Tags</taglib-uri>

<tags-location>/WEB-INF/myTags.xml</tags-location>

</tags>

d)<taglib>

<taglib-uri>my Tags</taglib-uri>

<taglib-location>/WEB-INF/my Tags.xml</taglib-location>

</taglib>

Question No: 57

Multiple Choice (There may be more than 1 correct answer)

A single @SpringBootApplication annotation can be used to enable those three features, that is:

Options:-

a)@EnableAutoConfiguration

b)@ComponentScan

c)@ConfigurationPropertiesScan

d)@EnableBootConfiguration

Question No: 56

Given:

1. import java.util.*; 2. public class Old {

3. public static Object get0(List list) { 4. return list.get(0);

5.}

6.}

Which three will compile successfully? (Choose three.)


Options:-

a)Object o= Old.get0(new LinkedList());

b)Object o= Old.get0(new LinkedList<?>());

c)Strings Old.get0(new LinkedList<String>());

d)Object o= Old.getO(new LinkedList<Object>());

e)String s = (String)Old.get0(new LinkedList<String>());

Question No: 55

Multiple Choice (There may be more than 1 correct answer)

Which of the following is true regarding the below Spring controller?

@RestController

public class OwnerController {

@RequestMapping(value = "/owner/ownerld}", method = RequestMethod.POST)

@ResponseBody

public Owner findOwner(@PathVariable("ownerld") int ownerld) {

return new Owner();

Options:-

a)RequestMethod. GET method is more accurate than POST

b)@PathVariable should be replaced with the @PathParam annotation

c)Returning the 201 HTTP status code is better

d)@ResponseBody could be removed

Question No: 54

Multiple Choice (Select 1 out of 4 options, for the question below.)

Given:

34. HashMap props = new HashMap();

35. props.put("key45", "some value");

36. props.put("key12", "some other value");

37. props.put("key39", "yet another value");

38. Set s = props.keySet();


39. // insert code here

What, inserted at line 39, will sort the keys in the props HashMap?

Options:-

A)Arrays.sort(s);

B)s= new TreeSet(s);

C)OCollections.sort(s);

D)s = new SortedSet(s);

Question No: 53

Multiple Choice (There may be more than 1 correct answer)

Identify the correct way of defining the Post method?

Options:-

A)@PostMapping(value="/insertproduct", produces = (MediaType APPLICATION JSON_VALUE))

B)@PostMapping(name="/insertproduct", produces (MediaType APPLICATION_JSON_VALUE))

C)@PostMapping(path="/insertproduct", produces = {MediaType.APPLICATION_JSON_VALUE))

D)@PostMapping("/insertproduct", produces = (MediaType.APPLICATION_JSON_VALUE})

Question No: 52

Multiple Choice (Select 1 out of 4 options, for the question below.)

The microservice layer is characterized by

1. being on different platforms

2. being written in different languages

3. being rigid to be individually replaced

4. Receive input from other micro services

Options:-

a)1,2 and 4

b)1, 2 and 3

c)1,3 and 4

d)1 and 3

Question No: 51
Multiple Choice (Select 1 out of 4 options, for the question below.)

Which of following is not valid syntax of using @RequestMapping annotation, in Spring MVC?

Options:-

a)@RequestMapping(method = RequestMethod.GET)

b)@RequestMapping("")

c)@RequestMapping(value="/offline", method = RequestMethod.GET)

d)@RequestMapping(name="/")

Multiple Choice (Select 1 out of 4 options, for the question below.)

50)To which is the code below equivalent to?

@Configuration

public class AcmeConfig {

@Bean

public AcmeService acmeService() { return new AcmeServicelmpl();

Options:-

a)<beans> <bean id="acmeConfig" class="com foo AcmeService"/> </beans>

b)<beans> <bean id="acmeService" class="com foo AcmeServicelmpl"/> </beans>

c)<beans> <bean id="acmeConfig" class="com.foo AcmeServicelmpl"/> </beans>

d)None of the above. The code will not run as intended. The @Bean requires a 'name' attribute

Multiple Choice (There may be more than 1 correct answer)

49) In Spring MVC, which of these are a valid use of the @PathVariable? Select all that apply.

OPTIONS:-

a)@RequestMapping(value="/users/{userid}")

public String viewUser(@PathVariable("users") String user, Model m)

b)@RequestMapping(value="/users/{userid)/addresses/{addressid}")
public String viewUserAddress(@PathVariable String userld, @PathVariable String addressid, Model
m)

c)@RequestMapping(value="/users/{userid}")

public String viewUser(@PathVariable("userid") String personnelld, Model m)

d)@RequestMapping(value="/users/{userld}")

public String viewUser(@PathVariable String userld, Model m)

Multiple Choice ( Select 1 out of 4 options, for the question below.)

48)Docker images can be built with spring boot jar so when the docker start the application also
starts. Which of the following is the conect Dockertesyntax.

a)FROM apline/java8

COPY app jar app jar

EXPOSE 8080

EXECUTE java jar app jar

b)FROM apline/java8

COPY app jar app.jar

EXPOSE 8080

CMD java jar app jar

c)FROM apline/java8

COPY app jar app jar

EXPOSE 8080

START java jar app.jar

d)FROM apline/java8

COPY app jar app jar

EXPOSE 8080

ENTRYPOINT java -jar app jar

Question No: 47
Multiple Choice (There may be more than 1 correct answer)

To publish spring microservices on the Cloud which of the following is preferred?

Options:-

a)Spring microservices can be bundled as docker images and can be used in the cloud

b)Spring microservices can be directly deployed on paas server heroku, pcf

c)Spring microservices required deployable war which can be deployed on tomcat like any
monolithic application

d)Spring microservices has not support for cloud

Multiple Choice (There may be more than 1 correct answer)

46)Which of these is true about Spring bean objects managed by the Spring container? Select all that
apply

Options:-

a)The bean object, not the container itself, contains bean-specific behavioral configuration data, like
scope, lifefecycle callbacks

b)Each bean also contain information about its package-qualified class name.

c)In the container, the beans are represented as BeanDefinition objects.

d)The container keeps an array of bean-to-collaborators mapping. The references to the


dependencies of beans are stored in the each individual bean object.

Question No: 45

Multiple Choice (There may be more than 1 correct answer)

Which ones are true about the @Qualifier annotation? Select all that apply.

Options:-

a)The @Qualifier annotation by default, is required to be present when the Autowired annotation is
used

b)The @Qualifier annotation can also be used on types and fields.

c)The @Qualifier annotation can be used on individual constructor arguments.

d)The @Qualifier annotation cannot be used on method parameters.

Question No: 44

Multiple Choice (Select 1 out of 5 options, for the question below.)

Given the JSP code:-


<% request.setAttribute("foo", "bar"); %>

and the Classic tag handler code: 5. public int doStartTag() throws JspException {

6. // insert code here.

7. // return int

8.)

Assume there are no other "foo" attributes in the web application. Which invocation on the
pageContext object, inserted at line 6, assigns "bar" to the variable x?

Options:-

a)String x = (String) pageContext.getAttribute("foo");

b)String x = (String) pageContext.getRequestScope("foo"),

c)It is NOT possible to access the pageContext object from within doStart Tag.

d)String x = (String)

pageContext.getRequest().getAttribute("foo"),

e)String x = (String) pageContext.getAttribute("foo". PageContext A NY_SCOPE),

Question No: 43

Multiple Choice (There may be more than 1 correct answer)

Select advantages of microservices architecture.

Options:-

a)Made up of several layers

b)Updates usually mean downtime

c)Technology trap

d)Single point of failure

e)Loose coupling

Question No: 42

Multiple Choice (Select 1 out of 4 options, for the question below.)

What is the output of the below script?

var s="Mphasis".substr(2,3);

console.log(s);
Options:-

a)h

b)hasis

c)has

d)Mphasis

Question No: 41

Multiple Choice (Select 1 out of 4 options, for the question below.)

In hibernate which method returns proxy object?

Options:-

a)load()

b)get()

c)getDatabase()

d)loadDatabase()

Question No: 40

Multiple Choice (Select 1 out of 4 options, for the question below.

Consider a base class as shown below:

@Entity

@Inheritance(strategy=InheritanceType.JOINED)

public class Vehicle {

} Two classes derived from this base class

@Entity public class Car extends Vehicle {

@Entity

public class Truck extends Vehicle

{}

How many tables are created to hold this data?

Options

a)3 tables

b)4 tables
c)1 table

d)2 tables

Question No: 39

Multiple Choice (There may be more than 1 correct answer)

What is the execution of the following code?

ModelAndView mv=new ModelAndView();

mv.setViewName("index.html");

mv.addObject("products", "Laptop,Keyboard,Watch");

return mv;

Options:-

a)Add an attribute to the model.

b)Set a view name for the ModelAndView

c)addObject() methods is incorrect

d)reate and return ModelAndView object

Question No: 38

Multiple Choice (Select 1 out of 4 options, for the question below.)

What is the output of below Angular Script in Template?

<div>

{{17.4558777 number:'4.0-4'}}

</div>

Options:-

a)0,017.4559

b)0,017.4558777

c)17.4559

d)17.4558777

Question No: 37

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which of the following is the right way of defining a default route in a router definitions?

Options:-
a){path=", component XXXComponent}

b){path=', URL)

c){path="/", component=XXXComponent}

d){path:'', component:XXXComponent}

Question No: 36

Multiple Choice (There may be more than 1 correct answer)

Given:

1. import java.util.";

2. public class Old {

3. public static Object geto (List list) {

4. return list.get(0);

5.}

6.)

Which three will compile successfully? (Choose three.)

Options:-

a)Object o Old.get0(new LinkedList());

b)Object o Old get0(new LinkedList<?>());

c)String s = Old get0(new LinkedList<String>()).

d)Object o= Old.get0(new LinkedList<Object>());

e)String s = (String)Old.get0(new LinkedList<String>());

Question No: 35

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which one of the following is a kind of technique that allows sharing the single physical instance of
an application organizations/customers?

Options:-

a)Virtualization

b)Service-Oriented Architecture

c)Grid Computing

d)Utility Computing

Question No: 34

Multiple Choice (There may be more than 1 correct answer)


Which building blocks of solutions are provided by Spring Cloud to simplify microservices
development?

Options:-

a)Systems management

b)Configuration management

c)Service discovery

d)Business management

e)Distributed sessions

Question No: 33

Multiple Choice (Select 1 out of 4 options, for the question below.)

What is the color of the text Sausage?

<ul class="shopping-list" id="awesome">

<li><span>Milk</span></li> <li class="favorite" id="must-buy"><span


class="highlight">Sausage</span>< </ul>

css:ul {

color: red;

color: blue;

Options:-

a)Red

b)Blue

c)Yellow

d)Green

Question No: 32

Multiple Choice (Select 1 out of 4 options, for the question below.)

is the packaging of software code with all it's necessary components like libraries, frameworks, and
other depecoens that they are isolated in their own container.

Options:-
a)Containerization

b)Virtualization

c)Orchestration

d)Shipping

Question No: 30

Multiple Choice (There may be more than 1 correct answer)

Which of these show valid ways of creating the ApplicationContext? Select all that apply.

Options:-

a)ApplicationContext context = new ClassPathXmlApplicationContext().setBeans(new String[]


(services

b)ApplicationContext ctx = new ClassPathXmlApplicationContext("conf/appContext.xml");

c)ApplicationContext ctx = ApplicationContext.getContext(new

FileSystemXmlApplicationContext("classpath.com appContent”)

d)ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath conf/appContext.xml"),

Question No: 29

Multiple Choice (There may be more than 1 correct answer)

In Spring MVC, which of these can be the return type of a method annotated with
@RequestMapping?

Options:-

a)ModelAndView

b)Model

c)Void

d)Map

Question No: 28

Multiple Choice (Select 1 out of 4 options, for the question below.)

What is the output of below Angular Script in Template?

<div>

{{"HELLOWORLD'|titlecase}}
</div>

Options:-

a)Hello World

b)HELLOWORLD

c)HelloWorld

d)Helloworld

Question No: 27

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which of the following statements are true about a Microservices?

1. A microservice is a large piece of code hosted for API calls.

2. A microservice is an atomic unit of code shared across multiple servers.

3. A microservices has smart end points and dumb pipes.

Options:-

a)1,2 and 3

b)1 and 2

c)2 and 3

d)1 and 3

Question No: 26

Multiple Choice (Select 1 out of 4 options, for the question below.)

________is like a big container in which all the software components of an application are clubbed
inside a single package.

Options:-

a)Monolithic architecture

b)Docker architecture

c)MVC architecture

d)Microservices architecture

Question No: 25

Multiple Choice (Select 1 out of 5 options, for the question below.)

To take advantage of the capabilities of modern browsers that use web standards, such as XHTML
and CSS, your web application is being converted from simple JSP pages to JSP Document format.
However, one of your JSPs, /scripts/screenFunctions isp. generates a Javation The This file is
included in several web forms to create screen-specific validation

functions and are included in these pages with the following statement:

10. <head>

11. <script src='/scripts/screenFunctions.jsp'

12. language="javascript'

13. type='application/javascript'></script>

14. </head>

15. <- body of the web form -->

Which JSP code snippet declares that this JSP Document is a JavaScript file?

Options:-

a)<%@ page contentType='application/javascript" %>

b)<jsp page contentType='application/javascript'/>

c)<jsp document contentType='application/javascript" />

d)<jsp.directive.page contentType='application/javascript"/>

e)No declaration is needed because the web form XHTML page already declares the MIME type

of the /scripts/screenFunctions.jsp file in the <script> tag

Question No: 24

Multiple Choice

(There may be more than 1 correct answer)

Which of these statements are true regarding the DataAccessException exception class hierarchy?
Select all that apply

Options:-

a)Its use helps convert proprietary checked exceptions, to a set of runtime exceptions.

b)Its use allows one to switch between persistence technologies fairly easily and it also allows one to
code without worrying about thingspecific to each technology.

c)DataAccessExceptions wrap the original exception.

d)DataAccessException is in the java.lang package.

Question No: 23
Multiple Choice (Select 1 out of 4 options, for the question below.)

Which is the correct way to set up an ngFor loop to create a new paragraph for each string in an
array of strings s

Options:-

a)<p ngFor=""let myStrings of s""> {{s}} </p>

b)<p *ngFor="""let s of myStrings"">{{ myStrings }} </p>

c)<p *ngFor="""let s of myStrings""> {{s}} </p>

d)<p ngFor=""let s of myStrings">{{s}} </p>

Multiple Choice (Select 1 out of 5 options, for the question below.)

22)The sl:shoppingList and sl:item tags output a shopping list to the response and are used as

follows:

11. <sl:shoppingList>

12. <sl:item name="Bread" />

13. <sl:item name="Milk" />

14. <sl:item name="Eggs" />

15. </sl:shoppingList>

The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for slitem is ItemSimple
Tag. ShoppingListTag extends Body TagSupport and ItemSimple Tag extends Simple TagSupport.
Which is true?

Options:-

a)Item Simple Tag can find the enclosing instance of ShoppingList Tag by calling getParent() and
casting the result to ShoppingListTag

b)ShoppingList Tag can find the child instances of ItemSimple Tag by calling super getChildren() and
casting each to an ItemSimple Ta It is impossible for ItemSimple Tag and ShoppingList Tag to find
each other in a tag hierarchy because one is a Simple tag and the c

c)ShoppingList Tag can find the child instances of ItemSimple Tag by calling getChildren() on the
PageContext and casting each to an

d)ItemSimple Tag can find the enclosing instance of ShoppingList Tag by calling

findAncestor With Class() on the PageContext and casting the result to ShoppingList Tag

Question No: 21
Multiple Choice (There may be more than 1 correct answer)

Which ones are valid when referring to other beans inside a <constructor-arg/> or <property/> in
bean definitions? Service

Options:-

a)<ref proxy="aService"/>

b)<ref bean="aBean"/>

c)<ref local="aBean"/>

d)<ref parent="aService"/>

Question No: 20

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which component life cycle hook is called immediately before Angular destroys the directive or
component?

Options:-

a)ngOnFinalize()

b)ngAfterDestory()

c)ngOnDestroy()

d)ngBeforeDestroy()

Question No: 19

Multiple Choice (Select 1 out of 4 options, for the question below.)

Which of the following statements is true regarding the @ResponseStatus annotation?

Options:-

a)@ResponseStatus is detected on nested exceptions

b)The ExceptionHandlerExceptionResolver uses the @ResponseStatus annotation to map exception


to HTTP status code

c)A controller handler is annotated with the @ResponseStatus, the response status set by
RedirectView takes precedence over the entity

d)The @ResponseStatus annotation can go on a @RequestMapping method or a @RestController


class or a business exception class

Question No: 18

Multiple Choice (There may be more than 1 correct answer)

What provides Spring Boot?


Options:-

a)Support for Jetty and Undertow as embedded containers

b)Java code generation

c)Auto-configuration of the Spring Framework and third libraries

d)Convenient dependency descriptors to load transitive dependencies

e)Support both Java-based and YAML for Spring application context configuration

Question No: 17

What is the output of the following code?

var myArray = []:

for (var i = 0; i <=4; i += 1) {

var y = i;

myArray.push(function () {

console.log(y);

})

myArray.forEach(function (func) {

func()

});

Options:-

a) 1

b)0

4
c)4

d)blank screen

e)error

Question No: 16

Multiple Choice (Select 1 out of 4 options, for the question below.)

What will be the output of the following code?

class Super {

int num = 20;

public void display() { System.out.println("super class method");

public class ThisUse extends Super {

int num;

public ThisUse(int num) {

this.num= num;

public void display() { System.out.println("display method");

public void Show() {

this.display();

Options:-

a)super class method display method 20 20

b)display method display method 10 10.

c)display method display method 20 20

d)super class method display method 10 10

Question No: 14
Multiple Choice (Select 1 out of 4 options, for the question below.)

What is the correct way to write a JavaScript array?

Options:-

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");

Question No: 15

Multiple Choice

(Select 1 out of 5 options, for the question below.)

What is the result of the following code snippet?

int[] array = (6,9,8);

List<Integer> list = new ArrayList<>();

list.add(array[0]); list.add(array[2]);

list.set(1, array[1]);

list.remove(0);

System.out.println(list);

Options:-

a)[8]

b)[9]

c)Something like [Ljava.lang.String:@160bc7c0]

d)An exception is thrown

e)The code does not compile

Question No: 13

Multiple Choice (Select 1 out of 4 options, for the question below

How do you display a border like this: The bottom border = 5 pixels

The top border = 10 pixels

The left border = 20 pixels

The right border = 1 pixel?


Options:-

a)border-width:10px 1px 5px 20px

b)border-width:10px 20px 5px 1px

c)border-width:10px 5px 20px 1px

d)border-width:5px 20px 10px 1px

Question No: 12

Multiple Choice (There may be more than 1 correct answer

What are the uses of Docker with Microservices?

Options:-

a)Faster start time

b)Faster deployment

c)Scalability

d)Single operating System

Question No: 11

Multiple Choice (There may be more than 1 correct answer)

Identify features of a Microservices system:

Options:-

a)Smart API endpoint

b)Vendor specific software

c)Stateless REST APIS

d)Single application

Question No: 10

Multiple Choice (Select 1 out of 4 options, for the question below.)

What is the output of the below script?

<script type="text/javascript">

x=4+"4"+true; document.write(x);
</script>

Options:-

a)44true

b)8

c)45

d)error

Question No: 09

Multiple Choice (There may be more than 1 correct answer)

You want to create a filter for your web application and your filter will implement javax.servlet.Filter.
Which two statements are true?

Options:-

a)Your filter class must implement an init method and a destroy method

b)Your filter class must also implement javax serviet FilterChain

c)When your filter chains to the next filter, it should pass the same arguments it received in its
doFilter method

d)The method that your filter invokes on the object it received that implements
javax.servlet.FilterChain can invoke either another filter or a serviet

e)Your filter class must implement a doFilter method that takes, among other things, an
HTTPServletRequest object and an HTTPServletResponse object

Question No: 08

Multiple Choice (There may be more than 1 correct answer)

What is the output of the following code?

1: interface Has Tail { int getTailLength(); } 2: abstract class Puma implements Has Tail {

3: protected int getTailLength() { return 4;}

4:}

5: public class Cougar extends Puma {

6: public static void main(String[] args) {

7: Puma puma = new Puma();

8: System.out.println(puma.getTailLength());

9:}
10:

11: public int getTail Length (int length) {return 2;}

12:}

Options:-

a)2

b)4

c)The code will not compile because of line 5.

d)The code will not compile because of line 7.

e)The code will not compile because of line 11.

f)The output cannot be determined from the code provided.

Question No: 07

Multiple Choice (Select 1 out of 4 options, for the question below.

Explain the below statement:

@Output() myEvent = new EventEmitter()

Options:-

a)Declares an output property that fires events that you cannot subscribe to with an event binding

b)Declares an output property that fires events that you can subscribe to with an event binding

c)Declares an output property that overrides events that you can subscribe to with an event binding

d)Declares an output property that subscribes events that you can subscribe to with an event
binding.

Question No: 06

Multiple Choice (Select 1 out of 4 options, for the question below)

What is the output of the following code ?

import (Component } from '@angular/core';

selector: 'my-app',

template: <div>

@Component({
<p>{{ myArray | slice: 2:7}}</p>

</div>

styleUrls: ['/app.component.css']

})

export class AppComponent {

name= 'Angular';

myArray = [0, 1, 2, 3, 4, 5, 6, 7, 8];

Options:-

a)2,3,4,5,6

b)0,1,2,3,4

c)8,7,6,5,4

d)Error

Question No: 05

Multiple Choice (There may be more than 1 correct answer)

The following code initializes three types representing the colors: red, green and blue.

type ColorType = [string, number, number, number]; let red: ColorType = ['Red', 1, 0, 0]; let green:
[string, number, number, number] = ['Green', 0, 1, 0];

let blue = ['Blue', 0, 0, 1);

Select all the statements that are correct.

Options:-

a)All three colors can have new elements of any type appended to them.

b)ColorType is an alias to a tuple.

c)All three colors would compile to the same JavaScript type signature.

d)ColorType is an array where the type of a fixed number of elements is known.

e)All three variables are immutable.

Question No: 04
Multiple Choice (Select 1 out of 4 options, for the question below.)

Which is detected when the mouse moves over a link?

Options:-

a)overMouse event

b)onMouseOver event

c)on RollOver event

d)OnMouseOut event

Multiple Choice (Select 1 out of 6 options. for the question below)

3)What is the output of the following code?

1: public class Deer (

2: public Deer() { System.out.print("Deer");)

3: public Deer(int age) (System.out.print("Deer Age"); } 4: private boolean hasHoms() { return false;)

4: private boolean hasHoms() { return false;)

5: public static void main(String[] args) {

6: Deer deer = new Reindeer(5):

7: System.out.println("."+deer.hasHoms());

8:)

9:}

10: class Reindeer extends Deer (

11: public Reindeer(int age) { System.out.print("Reindeer");}

12: public boolean hasHorns() { return true; }

13:}

Options:-

a)DeerReindeer,false

b)ReindeerDeer,false

c)DeerAgeReindeer,false

d)DeerAgeReindeer,true

e)The code will not compile because of line 7

f)The code will not compile because of line 12


Question No: 02

Multiple Choice (There may be more than 1 correct answer)

Which ones are incorrect? Select all that apply.

Options:-

a)The singleton scope is not available in a web-aware ApplicationContext.

b)Spring, out of the box, support 3 scopes. Custom scopes are created using the org
springframework.beans.factory.config Scopes

c)The scope which scopes a single bean definition to any number of object instances is called the
bean' scope

d)'Singleton' is the default scope.

Question No: 01

Multiple Choice (There may be more than 1 correct answer)

A developer wants a web application to be notified when the application is about to be shut down,
Which two actions are necessary to accomplish this goal? (Choose two.)

Options:-

a)include a listener directive in a JSP page

b)configure a listener in the TLD file using the <listener> element

c)include a <servlet-destroy> element in the web application deployment descriptor

d)configure a listener in the application deployment descriptor, using the <listener> element

e)include a class implementing ServletContextListener as part of the web application deployment

f)include a class implementing ContextDestroyedListener as part of the web application

deployment

You might also like