Erevmax Technologies: Final Test On Java and Advanced Java

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

ERevMax Technologies

in association with

InnoServ Solutions

Presents

FINAL TEST ON JAVA AND ADVANCED JAVA

Full Marks: 200 PASS MARKS: 100 TIME: 200 MIN NUMBER OF QUESTIONS: 121

All Questions are mandatory .Figures in right margin indicate marks for each question. There is no
negative marking. Answers should be written on question paper for Section 1 and 2 only. Overwriting
of answers will be deemed as a malicious practice. Hence be sure before answering the questions in
the answer sheet. Practical project needs to be compressed and sent to designated email. Adoption of
unfair means can lead to the cancellation of entire exam and reporting to appropriate authorities.

SECTION -1: FILL IN THE BLANKS [60 MARKS]

A) The three stages of a servlet are _______________, ____________________, and


_________________________. [3]
B) The name of the in-built Web Server present within Net beans IDE for testing Servlet and JSP
programs is ___________________ server. [1]
C) The “out” object present within a servlet belongs to the ________________ class. [1]
D) The HttpServlet class is present within the _______________ package. [1]
E) The name of the configuration file of any Web application in Java is known as
________________ [1]
F) The ________HttpServletRequest________ and ________HttpServletResponse_________
methods of the Servlet redirects the HttpRequest from the client to the service method.
[1]
G) The parameters passed within the doGet() / doPost() methods are objects of ______
HttpServletRequest ______ and _______HttpServletResponse______ class
[2]
H) The content type of Servlet must be set to _____________. [1]
I) The initial parameters of the Servlet are stored within the _______________ file. [1]
J) The name of the key parameter supplied with the Response object of the servlet using the
setHeader() method for refreshing a page is ________________ [1]
K) The return type of the getParameterNames() method of the request object is
________________ [1]
L) The ________________ method of the Enumeration object check whether any more further
objects is present within the Enumeration or not. [1]
M) The _______________, ___________________ and ___________________ method of the
request object helps to get the IPAddress, name and port of the remote client. [3]
N) The ______________ and ______________ methods of the reponse object helps to redirect a
servlet and throw an error respectively. [2]
O) The __________ method of the HttpSession object checks whether the session is new or not [1]
P) The ______________, _________________ and ___________________ method of the session
objects gets the ID, creation time and last accessed time respectively. [3]
Q) The __________________ or _________________ method of the session object helps to
destroy a session. [2]
R) The __________________ tag within the web.xml file can set the timeout of a session. [1]
S) The _______________ method of the ________________ class registers a new JDBC driver with
the Java Program. [1]
T) The ___________________ method of the _________________ instantiates the Connection
object. [2]
U) The ________________ method of the _________________ class instantiates a Statement
object. [2]
V) The ___________________ method of the _______________ class executed non – select
queries. [2]
W) The ___________________ method of the _______________ class executed select queries.[2]
X) The _____________ and _____________ are the parameters of the forward method of the
RequestDispatcher object. [2]
Y) If we need to pass parameters within SQL Query in a Java Program we should use the
___________________ class object instead of Statement class object. [1]
Z) The ______________ method of the RequestDispatcher object can forward from one servlet to
another. [1]
AA) The _________________ method of the ________________ class helps to count the number of
columns available within a ResultSet object. [1]
BB) The _______________ tag in the JSP Page can use a Java Bean. [1]
CC) The ________________ and __________________ tags is used to set and retrieve the values of
a Java Bean within a JSP Page. [1]
DD) The _______________ attribute of the Page directive is used to mark a JSP Page as an Error
Page. [1]
EE) The full form of JSON, XML, CSS, XSL, DTD, XSD is ______________________________________,
_______________________________, ______________________________,
__________________________________, _____________________________________, and
_____________________________________. [6]
FF) The attribute of the _____________ <input> tag in HTML5 makes the input mandatory. [1]
GG) The _______________ method the JSON object can convert a JSON object to string. [1]
HH) The ______________ method of the localStorage can store some value in the browser. [1]
II) The _______________ property of the _____________ object can redirect and HTML page
within JavaScript. [1]
JJ) JavaScript was originally developed by ________________________. [1]
KK) The ________________ function within JavaScript checks the input for a number or not. [1]
LL) The ________________ function within JavaScript creates a pop – up. [1]
MM) The ________________ function within JavaScript truncates excess space from an input.
[1]
NN) The _____________ method within JavaScript converts a string to integer. [1]
OO)The first processing instruction within an XML file which helps to identify the document as an
XML document is _________________________________________________ [3]
PP) The processing instruction within an XML file to attach a CSS with it is
__________________________________________________ [3]

SECTION -2: TRUE/FALSE [1 MARK EACH] [60 MARKS]

A) The init() method of the servlet runs for multiple times once the servlet has loaded in the Web
Server
B) The SYSTEM attribute within <!DOCTYPE> specifies that the DTD for an XML document is
present within the local machine.
C) All JavaScript functions has to be written within the <script></script> tag.
D) The DTD document itself is a non – XML document.
E) The XSL document itself is an XML document.
F) The CSS document itself is an XML document.
G) Statement class helps to pass parameters within an SQL query within a Java program.
H) The return type of the executeUpdate() method of the Statement object is double.
I) The return type of the execute() method of the Statement object is WebResult.
J) The finally method executed whether or not an exception occurs in a program
K) If you have to pick up values from multiple check boxes from an HTML file the names of the
checkboxes should be different.
L) The Session object gets destroyed once you close the browser.
M) The getParameterValue() method of the request object is required to pick multiple values from
CheckBoxes from an HTML File.
N) HTML code can be embedded within a Servlet.
O) The sendRedirect() method of the response object acts on the Web Browser.
P) The forward() method of the RequestDispatcher object acts on the Web Server.
Q) The destroy method executes whenever we close the browser.
R) Java code can be embedded within HTML in a JSP file.
S) The Math.random() method helps to return a double value between 0 to 1.
T) The getSession(false) method of the request object of servlet creates a new Session.
U) JavaScript can change HTML content.
V) Document.write() method does not delete the existing HTML content.
W) The keyword “var” is used to declare any variable in Javascript.
X) A JavaScript variable name can begin with a number.
Y) Any user-defined in JavaScript must be preceded with the keyword “function”
Z) Within JavaScript there can be ‘char’ datatype
AA) We can declare global variables in JavaScript
BB) XML was designed for both human-readable and machine-readable
CC) There can be duplicate attributes for an xml tag
DD) Xml is case-sensitive.
EE) Every opening tag must have an equivalent closing tag.
FF) Tags can be overlapped in XML
GG) Attribute values must be always quoted for an XML tag.
HH) Schema offers finer control over an XML document than a DTD.
II) XPath can be used to navigate through elements and attributes in an XML document
JJ) With XSLT you can transform an XML document into HTML.
KK) The #IMPLIED token makes an attribute mandatory
LL) Any unique value in the the attribute of an XML document can be specified by the token ID
MM) The IDREf token uses the value of an ID attribute.
NN) The JSP declaration tag helps to declare any fields as well as methods.
OO)The JSP expression tag helps to print the value of a variable.
PP) The JSP “include” directive can also include an HTML document within a JSP Page.
QQ) The JSP page does convert into a servlet before sending response to the client.
RR) We can do File Operations in both JSP and Servlets
SS) We can do database operations in both JSP and Servlets
TT) The mysql jar connector file is not required to be added with a Web Application dealing with
MYSQL database
UU) The Session variable in a servlet or JSP can die with the closing of the browser.
VV) We can use all sort of SQL statement in JDBC oriented programs.
WW) Servlets and JSP are used for creating Desktop applications in Java
XX) JavaScript is used for creating dymanic HTML pages.
YY) JavaSCript can be used for form validation in HTML.
ZZ) JSON can be an alternative to XML.
AAA) One servlet or JSP page can create multiple HTML pages
BBB) The IsErrorPage attribute prevent any JSP execeptions thrown in the current page.
CCC) The ASP and JSP technologies are quite similar in nature.
DDD) A JSP page can use only Java as its advanced programming language.
EEE) The “*” sign denotes one or more elements within a DTD for an XML document.
FFF) The “?” sign denotes zero or one element in a DTD for an XML document.
GGG) The “+” sign denotes zero or more elements for an XML document
HHH) Alternative elements can be used by using the “|” within a DTD for an XML document.

SECTION -3: Practicals [80 MARKS]

Create a table within mysql database called “TempRec” using the Services section of netbeans IDE. It
s which should have four columns called fno, sno, result, op with the datatypes of int, int, float, char
respectively. Create a Web Application using Net beans IDE called ErevWeb<Yourname>(eg. If your
name is “Raj” project name will be “ErevWebRaj”). Create a JSP page called Redirector.jsp with a
system of login and password. Create a new session which should store the “username” which
should be displayed in all the rest of servlet and jsp pages.It should also consist of the submit clear
and close button. Make the inputs of both the login and password as required. If the username and
password is “admin” and “admin” respectively it should redirect to another JSP page called
Tempcon.jsp which should have the facility to convert Celsius to Fahrenheit and vice-versa using a
Java Bean called TempCon.java within a package called tempack. If the username and password is
“user” and “user” it should be redirected to another HTML page called NumCal.html. For some other
username and password and error page should be displayed called DivideError.jsp which should be
invoked with the Error Page attribute of the JSP Page and by throwing a false exception within the
page. This web application should consist of a HTML Page (NumCal.html). It should have the facility
to add, subtract, multiply and divide two numbers. It should have three textboxes namely for two
inputs and one output. Proper javascript validation must be done for blank inputs and non numbers.
The selection of operations must be done using four radio buttons. All the HTML elements must be
nested within a form tag with the action attribute pointing towards a servlet called calculate.java.
The servlet should display the operands, operator and the result. It should again have a “Save” . The
Save button must redirect it to another Servlet called “DataSaver.java” which is going to save the
operands, operator and the result in a table within the mysql database. The servlet should display
the message of successful insertion of the records and also should display an hyperlink to a JSP page
called DataView.jsp using a hyperlink where all the records of the database table should get
displayed. Further it should have a “Export” button which should export all the records into an XML
page called DataView.xml and a “logout” button to invalidate the session.

SECTION -4: PERSONAL INFORMATION

A) FULL NAME__________________________________.
B) EMPNO.__________________________________.
C) DESIGNATION:_______________________________.
D) EMAIL ID_______________________________
E) SKYPE ID_________________________________

SECTION -5: FOR OFFICE USE ONLY (PLEASE LEAVE IT BLANK)

MARKS OBTAINED:

INVIGILATOR:

DATE:

COMMENTS:

================================= ===THE END=========================================

You might also like