Java - 15

1)   Which statement provides an easy way to dispatch execution to different parts of your code based on the value of an expression?

a. If
b. Switch
c. Nested-if
d. if-else-if
Answer  Explanation 

ANSWER: Switch

Explanation:
No explanation is available for this question!


2)   Give the Output for the following program?

class Char {
public static void main(String args[]) {
char ch1, ch2;
ch1 = 88; // code for X
ch2 = 'Y';
System.out.print("ch1 and ch2: ");
System.out.println(ch1 + " " + ch2);
}
}


a. ch1 and ch2: X Y
b. ch1 and ch2: x y
c. ch1 and ch2: 1 3
d. None of the above
Answer  Explanation 

ANSWER: ch1 and ch2: X Y

Explanation:
No explanation is available for this question!


3)   Which field of StreamTokenizer if the token is a word, this filed contains the word that can be used in programming?

a. String sval
b. double nval
c. int ttype
d. static final int TT_WORD
Answer  Explanation 

ANSWER: double nval

Explanation:
No explanation is available for this question!


4)   Which Thread pool is used where container creates a thread pool to process the request?

a. Servlet
b. JSp
c. All of the above
d. None of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!


5)   Which is used to separate the hierarchy of the class while declaring an import statement?

a. Package
b. Applet
c. Browser
d. All of the above
Answer  Explanation 

ANSWER: Package

Explanation:
No explanation is available for this question!


6)   Classes in the same package cannot access each other's package-access members.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


7)   Which method of string class in java is used to convert the boolean into String?

a. public static String valueOf(double I)
b. public static String valueOf(boolean I)
c. public boolean equals(Object anObject)
d. public static String valueOf(Object obj)
Answer  Explanation 

ANSWER: public static String valueOf(double I)

Explanation:
No explanation is available for this question!


8)   By overriding the toString() method of the Object class, we can return values of the object, so we don't need to write much code.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


9)   Which Exception occurs when a class is not found while dynamically loading a class using the class loaders?

a. ClassNotFoundException
b. ClassFoundException
c. NoClassDefFoundError
d. ClassDefFoundError
Answer  Explanation 

ANSWER: ClassNotFoundException

Explanation:
No explanation is available for this question!


10)   JDBC RowSet is the wrapper of ResultSet,It holds tabular data like ResultSet but it is easy and flexible to use.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


11)   What type of servlets use these methods doGet(), doPost(),doHead, doDelete(), doTrace()?


a. Genereic Servlets
b. HttpServlets
c. All of the above
d. None of the above
Answer  Explanation 

ANSWER: HttpServlets

Explanation:
No explanation is available for this question!


12)   Which type of ServletEngine is a server that includes built-in support for servlets?

a. Add-on ServletEngine
b. Embedded ServletEngine
c. Standalone ServletEngine
d. None of the above
Answer  Explanation 

ANSWER: Standalone ServletEngine

Explanation:
No explanation is available for this question!


13)   Struts combines which of these in to a unified Framework?

a. Java Servlets
b. Java Server pages
c. Custom tags and Message Resources
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


14)   We need to write the controller code self, If we change the controller code, we need to recompile the class and redeploy the application this is a disadvantage of which MVC Architecture?

a. MVC 1 Architecture
b. MVC 2 Architecture
c. All of the above
d. None of the above
Answer  Explanation 

ANSWER: MVC 2 Architecture

Explanation:
No explanation is available for this question!


15)   EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


16)   Which EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components?

a. Transaction support
b. Persistence support
c. Naming support
d. All mentioned above
Answer  Explanation 

ANSWER: Naming support

Explanation:
No explanation is available for this question!


17)   In RMI, the objects are passed by _____.

a. Value
b. Reference
c. Value and Reference
d. None of the above
Answer  Explanation 

ANSWER: Value

Explanation:
No explanation is available for this question!


18)   RMI and EJB, provides services to access an object running in another JVM (known as remote object).

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


19)   Which two interfaces does the javax.servlet.jsp package have?

a. JspPage
b. HttpJspPage
c. JspWriter
d. PageContext
e. Both A & B
Answer  Explanation 

ANSWER: Both A & B

Explanation:
No explanation is available for this question!


20)   In JSP Action tags which tags are used for bean development?

a. jsp:useBean
b. jsp:setPoperty
c. jsp:getProperty
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


21)   Which driver Network connection is indirect that a JDBC client makes to a middleware process that acts as a bridge to the DBMS server?

a. JDBC-Net
b. JDBC-ODBC bridge
c. Native API as basis
d. Native protocol as basis
Answer  Explanation 

ANSWER: JDBC-Net

Explanation:
No explanation is available for this question!


22)   Which Indicates a result set that cannot be updated programmatically in concurrency?

a. CONCUR_UPDATABLE
b. CONCUR_READ_ONLY
c. All of the above
d. None of the above
Answer  Explanation 

ANSWER: CONCUR_READ_ONLY

Explanation:
No explanation is available for this question!


23)   The APPLET tag is used to start an applet from both an HTML document and from an applet viewer.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


24)   Which class is used for this Processing Method processActionEvent( )?

a. Button,List,MenuItem
b. Button,Checkbox,Choice
c. Scrollbar,Component,Button
d. None of the above
Answer  Explanation 

ANSWER: Button,List,MenuItem

Explanation:
No explanation is available for this question!


25)   Which is used to store data and partial results, as well as to perform dynamic linking, return values for methods, and dispatch exceptions?


a. Window
b. Panel
c. Frame
d. Container
Answer  Explanation 

ANSWER: Frame

Explanation:
No explanation is available for this question!