Final FSD Java Assessment
Final FSD Java Assessment
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
Question No: 89
Which of the following is true for the generation strategy SEQUENCE for primary key generation?
Options:-
c)It uses a shared table where sequential primary keys are stored
Question No: 88
Options:-
a)loadDatabase()
b)load()
c) get()
d)getDatabase()
Question No: 87
Options:-
Question No: 86
Options:-
Question No: 85
Options:-
Question No: 84
Options:-
A. )JsonPipe
B.) KeyValuePipe
C. )DatePipe
D.) Observable
Question No. 83
Options:-
A. )Iterator
B. )ListIterator
C. )Setiterator
D.) Maplterator
Question No: 82
Options:-
Question No: 81
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
4:}
8: System.out.println(puma.getTailLength());
9:}
10:
12:}
Options:-
A. )2
B.) 4
Question No: 79
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
Options:-
C. )A class that references one or more objects of other classes in instance variables
Question No: 77
Which one of the following is the proper way to include java.util package in your jsp page?
Options:-
Options:-
A.) a,c,e
B. )b,d
C. )a,b,c
D. )c,d,e
Question No. 75
Options:-
B.) The <c:url> tag formats a URL into a string and stores it into the variable
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
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.)
Options:-
Question No: 71
class ClassA
System.out.print("a");
try {
} finally {
System.out.print("d"),"
System.out.print("e");
Optons:-
A .) abe
B. )abce
C. )abde
D . )abcde
Question No: 70
Multiple Choice (Select 1 out of 4 options, for the question below.)
<html>
<head></head>
<body>
</body>
</html>
Options:-
Question No: 69
Which method of TestServlet will get executed on clicking submit button of the following code?
</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
Question No: 67
session.setAttribute("name", "Mphasis");
System.out.println(session.getAttribute("name");
session.invalidate(0);
if (session.isNew()) {
} else {
System.out.println(session.isNew());
Options:-
C. )Throws exception
Question No: 66
Multiple Choice (There may be more than 1 correct answer)
Options:-
A. )colors
B. )time
C . )datetime
D )number
Question No: 65
function aaa() {
return
test: 1
}:
alert(typeof aaa());
Options:-
A.) Function
B. )Number
C. )Object
D. )undefined
Question No: 64
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.)
Options:-
B. )Transient State
Question No: 62
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
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)
Question No: 60
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
Options:-
C. )<context:configuration>
Question No:58
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
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:
5.}
6.}
Question No: 55
@RestController
@ResponseBody
Options:-
Question No: 54
Given:
What, inserted at line 39, will sort the keys in the props HashMap?
Options:-
A)Arrays.sort(s);
C)OCollections.sort(s);
Question No: 53
Options:-
Question No: 52
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("")
d)@RequestMapping(name="/")
@Configuration
@Bean
Options:-
d)None of the above. The code will not run as intended. The @Bean requires a 'name' attribute
49) In Spring MVC, which of these are a valid use of the @PathVariable? Select all that apply.
OPTIONS:-
a)@RequestMapping(value="/users/{userid}")
b)@RequestMapping(value="/users/{userid)/addresses/{addressid}")
public String viewUserAddress(@PathVariable String userld, @PathVariable String addressid, Model
m)
c)@RequestMapping(value="/users/{userid}")
d)@RequestMapping(value="/users/{userld}")
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
EXPOSE 8080
b)FROM apline/java8
EXPOSE 8080
c)FROM apline/java8
EXPOSE 8080
d)FROM apline/java8
EXPOSE 8080
Question No: 47
Multiple Choice (There may be more than 1 correct answer)
Options:-
a)Spring microservices can be bundled as docker images and can be used in the cloud
c)Spring microservices required deployable war which can be deployed on tomcat like any
monolithic application
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.
Question No: 45
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
Question No: 44
and the Classic tag handler code: 5. public int doStartTag() throws JspException {
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:-
c)It is NOT possible to access the pageContext object from within doStart Tag.
d)String x = (String)
pageContext.getRequest().getAttribute("foo"),
Question No: 43
Options:-
c)Technology trap
e)Loose coupling
Question No: 42
var s="Mphasis".substr(2,3);
console.log(s);
Options:-
a)h
b)hasis
c)has
d)Mphasis
Question No: 41
Options:-
a)load()
b)get()
c)getDatabase()
d)loadDatabase()
Question No: 40
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Entity
{}
Options
a)3 tables
b)4 tables
c)1 table
d)2 tables
Question No: 39
mv.setViewName("index.html");
mv.addObject("products", "Laptop,Keyboard,Watch");
return mv;
Options:-
Question No: 38
<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
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
Given:
1. import java.util.";
4. return list.get(0);
5.}
6.)
Options:-
Question No: 35
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
Options:-
a)Systems management
b)Configuration management
c)Service discovery
d)Business management
e)Distributed sessions
Question No: 33
css:ul {
color: red;
color: blue;
Options:-
a)Red
b)Blue
c)Yellow
d)Green
Question No: 32
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
Which of these show valid ways of creating the ApplicationContext? Select all that apply.
Options:-
FileSystemXmlApplicationContext("classpath.com appContent”)
Question No: 29
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
<div>
{{"HELLOWORLD'|titlecase}}
</div>
Options:-
a)Hello World
b)HELLOWORLD
c)HelloWorld
d)Helloworld
Question No: 27
Options:-
a)1,2 and 3
b)1 and 2
c)2 and 3
d)1 and 3
Question No: 26
________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
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>
12. language="javascript'
13. type='application/javascript'></script>
14. </head>
Which JSP code snippet declares that this JSP Document is a JavaScript file?
Options:-
d)<jsp.directive.page contentType='application/javascript"/>
e)No declaration is needed because the web form XHTML page already declares the MIME type
Question No: 24
Multiple Choice
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.
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:-
22)The sl:shoppingList and sl:item tags output a shopping list to the response and are used as
follows:
11. <sl:shoppingList>
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
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
Options:-
c)A controller handler is annotated with the @ResponseStatus, the response status set by
RedirectView takes precedence over the entity
Question No: 18
e)Support both Java-based and YAML for Spring application context configuration
Question No: 17
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
class Super {
int num;
this.num= num;
this.display();
Options:-
Question No: 14
Multiple Choice (Select 1 out of 4 options, for the question below.)
Options:-
Question No: 15
Multiple Choice
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]
Question No: 13
How do you display a border like this: The bottom border = 5 pixels
Question No: 12
Options:-
b)Faster deployment
c)Scalability
Question No: 11
Options:-
d)Single application
Question No: 10
<script type="text/javascript">
x=4+"4"+true; document.write(x);
</script>
Options:-
a)44true
b)8
c)45
d)error
Question No: 09
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
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
1: interface Has Tail { int getTailLength(); } 2: abstract class Puma implements Has Tail {
4:}
8: System.out.println(puma.getTailLength());
9:}
10:
12:}
Options:-
a)2
b)4
Question No: 07
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
selector: 'my-app',
template: <div>
@Component({
<p>{{ myArray | slice: 2:7}}</p>
</div>
styleUrls: ['/app.component.css']
})
name= 'Angular';
Options:-
a)2,3,4,5,6
b)0,1,2,3,4
c)8,7,6,5,4
d)Error
Question No: 05
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];
Options:-
a)All three colors can have new elements of any type appended to them.
c)All three colors would compile to the same JavaScript type signature.
Question No: 04
Multiple Choice (Select 1 out of 4 options, for the question below.)
Options:-
a)overMouse event
b)onMouseOver event
d)OnMouseOut event
3: public Deer(int age) (System.out.print("Deer Age"); } 4: private boolean hasHoms() { return false;)
7: System.out.println("."+deer.hasHoms());
8:)
9:}
13:}
Options:-
a)DeerReindeer,false
b)ReindeerDeer,false
c)DeerAgeReindeer,false
d)DeerAgeReindeer,true
Options:-
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
Question No: 01
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:-
d)configure a listener in the application deployment descriptor, using the <listener> element
deployment