Home
Current Affairs January 2024

What is the correct answer?

4

In a single Servlet class we can use____________

A. doGet(...) method only

B. doPost(...) method only

C. doGet(...) method and doPost(...) method both at a time.

D. Either 'a' or 'b'

Correct Answer :

C. doGet(...) method and doPost(...) method both at a time.


Related Questions

What is the correct answer?

4

It is perfectly legal to assign a subclass object to a supper class reference.

A. True

B. False

What is the correct answer?

4

If m and n are int type variables, what will be the result of the expression
'm % n' when m = -14 and n = -3?

A. 4

B. 2

C. -2

D. -4

What is the correct answer?

4

Which of the following methods can be used to change the size of a
size() *
resize()

A. component

B. dimension()

C. setSize()

D. size()

What is the correct answer?

4

Objects are passed to a method by use of call-by-reference.

A. True

B. False

What is the correct answer?

4

A class may be both abstract and final.

A. True

B. False

What is the correct answer?

4

The use of protected keyword to a member in a class will restrict its visibility as follows:

A. Visibility only in the class and its subclasses in the same package.

B. Visibility only inside the same package.

C. Visibility in all classes in the same package and subclasses in other packages.

D. Visibility only in the class where it is declared.

What is the correct answer?

4

Session bean

A. Represents a single client inside the application server

B. Can not be shared

C. Is not persistent

D. Satisfies all of the above conditions

What is the correct answer?

4

For all insert, update, delete, query operations on a database, ResultSet object creation is mandatory.

A. True.

B. False.

What is the correct answer?

4

Submit button always fires doPost(...)

A. True

B. False

What is the correct answer?

4

A string object can not be modified after it is created.

A. True

B. False

What is the correct answer?

4

A JSP file can be stored_________________

A. With the extension .jsp in servlets folder of the jws

B. With the extension .html in public_html folder of the jws

C. With the extension .jsp in public_html folder of the jws

D. None of the above.

What is the correct answer?

4

executeUpdate(------------) returns ___________

A. Nothing

B. Returns a ResultSet object

C. Returns an integer value to show the no. of updated rows

D. None of the above.

What is the correct answer?

4

In evaluating a logical expression of type 'Boolean expression 1&& Boolean expression 2', both the Boolean expressions are not always evaluated.

A. True

B. False

What is the correct answer?

4

What is error in the following class definitions? 
abstract class xy { 
abstract sum(int x, int y) {
}
}

A. class header is not define properly

B. constructor is no defined

C. method is not defined properly

D. no error

What is the correct answer?

4

To delete a file, we can use an instance of class file.

A. True

B. False

What is the correct answer?

4

Consider the following class definition.
Class Student extends String
{
}
What happens when we try to compile this class?

A. Will not compile because class body is not defined

B. Will not compile because class is not declared public

C. Will compile successfully.

D. Will not compile because String is abstract

What is the correct answer?

4

When present, package must be the first no comment statement in the file.

A. True

B. False

What is the correct answer?

4

In a single Servlet class we can use____________

A. doGet(...) method only

B. doPost(...) method only

C. doGet(...) method and doPost(...) method both at a time.

D. Either 'a' or 'b'

What is the correct answer?

4

Any method in a supper class can be over ridden in its subclass.

A. True

B. False

What is the correct answer?

4

It is perfectly legal to refer to any instance variable inside of a static method.

A. True

B. False

What is the correct answer?

4

If a=10 and b= 15, then the statement x =(a>b)?a:b; assigns the value 15 to x.

A. True

B. False

What is the correct answer?

4

Given the code
String s = new String("abc");
Which of the following calls are valid?

A. s.toUpperCase()

B. s.append("xyz")

C. s.setCharAt(1<'A')

D. all of the above

What is the correct answer?

4

DriverManager.getConnection("jdbc:odbc:dsn_name") method does not depend on the class.forName(...) method.

A. True.

B. False.

What is the correct answer?

4

A package is a collection of

A. classes

B. interface

C. editing tools

D. classes and interfaces

What is the correct answer?

4

With javadoc, which of the following denotes a javadoc comment?

A. //#

B. /*

C. /**

D. //**

What is the correct answer?

4

When the string objects are compared with ==, the result is true If the strings contain the same values.

A. True

B. False

What is the correct answer?

4

It is an error to catch the same type of exception in two different catch blocks associated with a particular try block.

A. True

B. False

What is the correct answer?

4

Consider the following statements:
int x = 10, y = 15; 
x = ((x < y) ? (y + x) : (y - x);

What will be the value of x after executing these statements?

A. 25

B. 15

C. 5

D. Error can't be executed.

What is the correct answer?

4

Java is fully object oriented programme.

A. true

B. false

What is the correct answer?

4

The break statement is required in the default case of a switch selection structure.

A. True

B. False