Java - 14

1)   An interface is a blueprint of a class. It has static constants and abstract methods.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


2)   Which variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed?

a. Local variables
b. Instance variables
c. Class Variables
d. Static variables
Answer  Explanation 

ANSWER: Instance variables

Explanation:
No explanation is available for this question!


3)   Breaking a string or stream into meaningful independent words is known as tokenization.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


4)   What can be accessed or inherited without actual copy of code to each program?

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

ANSWER: Package

Explanation:
No explanation is available for this question!


5)   Which provides accessibility to classes and interface?

a. import
b. Static import
c. All the above
d. None of the above
Answer  Explanation 

ANSWER: import

Explanation:
No explanation is available for this question!


6)   The following program is an example of?

class Simple{
public static void main(String args[]){

String s="Sachin";
System.out.println(s.length());//6
}
}


a. length() method
b. intern() method
c. trim() method
d. charAt() method
Answer  Explanation 

ANSWER: length() method

Explanation:
No explanation is available for this question!


7)   If you are inserting any value in the wrong index as shown below,

1. int a[]=new int[5];
2. a[10]=50;

it would result in ______.


a. NullPointerException
b. ArrayIndexOutOfBoundsException
c. ArithmeticException
d. NumberFormatException
Answer  Explanation 

ANSWER: ArrayIndexOutOfBoundsException

Explanation:
No explanation is available for this question!


8)   Packages are used for distributing a collection of reusable classes, usually in a format known as Java Archive (JAR) file.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


9)   The following program is an example for?

class Student{
int id;
String name;

void display(){System.out.println(id+" "+name);}

public static void main(String args[]){
Student s1=new Student();
Student s2=new Student();
s1.display();
s2.display();
}
}


a. Parameterized constructor
b. Default Constructor
c. Overloading Constructor
d. None of the above
Answer  Explanation 

ANSWER: Default Constructor

Explanation:
No explanation is available for this question!


10)   Which is used to call the stored procedures and functions?

a. CallableStatement Interface
b. PreparedStatement Interface
c. All the above
d. None of the above
Answer  Explanation 

ANSWER: CallableStatement Interface

Explanation:
No explanation is available for this question!


11)   Which interfaces provide methods for batch processing in JDBC?

a. java.sql.Statement
b. java.sql.PreparedStatement
c. All the above
d. None of the above
Answer  Explanation 

ANSWER: All the above

Explanation:
No explanation is available for this question!


12)   Sessions is a part of the SessionTracking and it is for maintaining the client state at server side.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


13)   Which cookie it is valid for single session only and it is removed each time when the user closes the browser?

a. Persistent cookie
b. Non-persistent cookie
c. All the above
d. None of the above
Answer  Explanation 

ANSWER: Non-persistent cookie

Explanation:
No explanation is available for this question!


14)   Which configuration files are used in Struts?

a. ApplcationResources.properties
b. struts-config.xml
c. All the above
d. None of the above
Answer  Explanation 

ANSWER: All the above

Explanation:
No explanation is available for this question!


15)   Interceptor can change the flow of the application by returning the string.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


16)   Which component does the Entity bean represent the persistent data stored in the database?

a. Server-side component
b. Client-side component
c. server and client side component
d. None of the above
Answer  Explanation 

ANSWER: Server-side component

Explanation:
No explanation is available for this question!


17)   A session bean represents a multiple clients inside the Application Server.

a. True
b. False


Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


18)   What are the exceptions which have to be handled in a RMI client program?

a. RemoteException
b. NotBoundException
c. MalFormedURLException
d. All mentioned above
Answer  Explanation 

ANSWER: All mentioned above

Explanation:
No explanation is available for this question!


19)   RMI uses a layered architecture; each of the layers could be enhanced or replaced without affecting the rest of the system.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


20)   Which of the following is an advantage of the statement – Separation of business logic from JSP ?

a. Custom Tags in JSP
b. JSP Standard Tag Library
c. All the above
d. None of the above
Answer  Explanation 

ANSWER: Custom Tags in JSP

Explanation:
No explanation is available for this question!


21)   Which kind of driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, IBM DB2, or other DBMS?

a. JDBC-ODBC bridge plus ODBC driver
b. Native-API partly-Java driver
c. JDBC-Net pure Java driver
d. Native-protocol pure Java driver
Answer  Explanation 

ANSWER: Native-API partly-Java driver

Explanation:
No explanation is available for this question!


22)   What invokes immediately after the start() method and also any time the applet needs to repaint itself in the browser?

a. stop()
b. init()
c. paint()
d. destroy()
Answer  Explanation 

ANSWER: paint()

Explanation:
No explanation is available for this question!


23)   Applets cannot make network connection exception to the server host from which it originated.

a. True
b. False


Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


24)   Which method can set or change the text in a Label?

a. setText()
b. getText()
c. All the above
d. None of the above
Answer  Explanation 

ANSWER: setText()

Explanation:
No explanation is available for this question!


25)   Which defines a method called nextElement that is used to get the next element in a data structure that contains multiple elements?

a. Bitset
b. Vector
c. Stack
d. Enumeration
Answer  Explanation 

ANSWER: Enumeration

Explanation:
No explanation is available for this question!