0

programming languages Online Quiz - 267

Description: programming languages Online Quiz - 267
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0
  1. The HttpServletRequestWrapper is an example of the Decorator pattern.

  2. The HttpServletRequestWrapper can be used to extend the functionality of a servlet request.

  3. A subclass of HttpServletRequestWrapper CANNOT modify the behavior of the getReader method.

  4. An HttpServletRequestWrapper may be used only by a class implementing the javax.servlet.Filter interface.

  5. An HttpServletRequestWrapper CANNOT be used on the request passed to the RequestDispatcher.include

  6. An HttpServletRequestWrapper may modify the header of a request within an object implementing the


Correct Option: A,B,F
  1. Create new session if the session does not already exist

  2. Returns null if session does not already exist

  3. Returns false

  4. Destroy the session


Correct Option: B
  1. No difference, both are the same

  2. An Object maynot have a class definition, but an instance must have a class definition

  3. An Object must have a class definition, but an instance may not have a class definition

  4. Object and Instance should have different class definitions. It can not be the same.


Correct Option: B

Is a skeleton created by RMI?

  1. True

  2. False


Correct Option: A

If a method is declared as protected, where may the method be accessed?

  1. Interfaces of the same package and other packages

  2. Classes of the same package

  3. Classes of the same package and other packages

  4. Interfaces of the same package


Correct Option: B,D

A dead thread can be restarted by calling the start() method again on that object

  1. True

  2. False


Correct Option: B

The default value of the boolean type is

  1. True

  2. False


Correct Option: B

EJB and Java beans can be run on many systems?

  1. True

  2. False


Correct Option: B

he following code is not well-written. What does the program do? Void main() { int a=1, b=2, c=3,d=4; printf("%d %d", a, b); printf (" %d %d", c, d); }

  1. Run-Time Error

  2. Compile-Time Error

  3. 1 2 3 4

  4. None of above


Correct Option: C

What will be the output of the following program : void main() { int a=5; int b=6;; int c=a+b; printf("%d",c); }

  1. Compile-Time Error

  2. Run-Time Error

  3. 11

  4. None of above


Correct Option: C

What will be the output of the following program : void main() { int i,j; for (i=1; i<=3; i++) for (j=1; j<3; j++) { if (i == j) continue; if ((j % 3) > 1) break; printf("%d",i); } }

  1. 2,3

  2. 3,2

  3. 2,2

  4. 3,3


Correct Option: A

What will be the output of the following program : #define swap(a,b) temp=a; a=b; b=temp; void main() { static int a=5,b=6,temp; if (a > b) swap(a,b); printf("a=%d b=%d",a,b); }

  1. a=5 b=6

  2. a=6 b=5

  3. a=6 b=0

  4. None of the above


Correct Option: C

What will be the output of the following program : void main() { int x=4,y=3,z=2; &z=&x*&y; printf("%d",z); }

  1. Compile-Time error

  2. Run-Time Error

  3. 24

  4. Unpredictable


Correct Option: C
- Hide questions