Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Question: 1
a. String
b. Stringbuffer
Question: 2
a. Integer
b. Long
c. Boolean
d. Character
Question: 3
a. join, wait
b. sleep, join
c. wait, join
d. sleep, wait
Question: 4
a. 1
b. 2
c. 3
c. 1 & 2
d. 1 & 3
e. 2 & 3
f. All of the above
Question: 5
Question: 6
Which of these classes defined in java.io and used for file-handling are abstract.
Select the two correct answers.
a. InputStream
b. PrintStream
c. Reader
d. FileInputStream
e. FileWriter
Question: 7
Which of the following options are true for the below code snippet?
Class Test
{
public static void printMessage(String msg)
{ System.out.println(msg); }
Question: 8
Name the Collection interface implemented by the Hashtable class.
a. List
b. Map
c. Set
Question: 9
What will be the output when we try to compile and run following code.
Assume that this main method is written in proper java class.
a. 30
b. Unpredictable
c. Compile time error
d. run time error
Question: 10
class Base
{
Base() { System.out.print(“Base”); }
}
a. Base
b. BaseBase
c. Compilation fails.
d. The code runs with no output.
e. An exception is thrown at runtime.
Question: 11
What if user didn't add the String array as the argument to the method.
Question: 12
a. Max
b. Min
c. Low
Question: 13
What will happen when you attempt to compile and run the following code
int Output=10;
boolean b1 = false;
if((b1==true) && ((Output+=10)==20))
{
System.out.println("We are equal "+Output);
}
else { System.out.println("Not equal! "+Output);}
Question: 14
Suppose, One class is using TreeMap to store the Key-Value pairs and four key-value
pairs are inserted into the TreeMap where as keys are :- abcd, 111a, a111, 1111.
Question: 15
a. No.
b. Yes. It should be static
c. Yes. It should be final
d. Yes. It should be final and static
Question: 16
If you are not sure that whether your collection needs to be thread safe or not then
which out the following is better to use :-
a. Vector
b. Use Arraylist and convert it to thread safe using
Collections.synchronizedList(ArrayList object)
Question: 17
a. 0 to 256
b. -128 to 127
c. -128 to 128
d. 0 to 255
Question: 18
Question: 19
a. Yes
b. No
Question: 20
Question: 21
a. 8
b. 10
c. 11
d 7
e. None of the above
Question: 22
Which of the following implicit objects does not represent a scope container?
a. application
b. session
c. request
d. page
e. pageContext
Question: 23
a. java.lang.PageContext
b. javax.servlet.jsp.PageContext
c. javax.servlet.PageContext
d. javax.servlet.http.PageContext
Question: 24
a. application
b. session
c. page
d. request
Question: 25
<html><body>
<% x=3: %>
<% int x = 5; %>
<%! Nt x = 7; %>
x= <%=x %>, <%= this.x %>
</body></html>
a. x =3, 5
b. x = 3,7
c. x= 5, 3
d. x = 5, 7
e. Compilation Error
Question: 26
a. 7
b. 6
c. 5
d. 8
e. None of the above
Question: 27
Question: 28
a. Yes
b. No
Question: 29
a. application
b. session
c. exception
d. config
Question: 30
Question: 31
What will be the output of the page source for the below comment:
Question: 32
a. javax.servlet.ServletException
b. javax.servlet.jsp.JSPException
c. javax.servlet.ServletException and javax.servlet.JSPException
d. javax.servlet.ServletException and java.io.IOException
e. javax.servlet.jsp.JSPException and java.io.IOException
Question: 33
How to tell the browser not to cache the JSP output?Select all that are applicable
a. response.setHeader("Pragma", "No-cache");
b. response.setHeader("Cache-Control", "no-cache");
c. response.setDateHeader("Expires",0);
d. response.setcache(false);
e. none
Question: 34
The page directive is used to convey information about the page to JSP container.
Which of these are legal syntax of page directive. Select the two correct statement
Question: 35
What's a better approach for enabling thread-safe servlets and JSPs in high volume
sites?
a. SingleThreadModel Interface
b. Synchronization?
Question: 36
Question: 37
a. True
b. False
Question: 38
a. page == this
b. pageContext == this
c. out instanceof ServletOutputStream
d. application instanceof ServletContext
Question: 39
Which of the following can not be used as the scope when using a JavaBean with
JSP?
a. application
b. session
c. request
d. response
e. page
Question: 40
a. Yes
b. No