The Servlet Response interface enables a servlet to formulate a response for a client using the method ............... (A) void log(Exception e, String s) (B) void destroy() (C) int getServerPort() (D) void setContextType(String Type)

1 Answer

Answer :

(D) void setContextType(String Type)

Related questions

Description : Consider the following JAVA program: public class First { public static int CBSE (int x) { if (x < 100) x = CBSE (x +10); return (x - 1); } public static void main (String[] args){ System.out.print(First.CBSE(60)); } } What does this program print? (1) 59 (2) 95 (3) 69 (4) 99

Last Answer : (2) 95 

Description : State whether true or false. i) init( ) of servlet is called after a client request comes in ii) Servlets are ultimately converted into JSP A) i-false, ii-false B) i-false, ii-true C) i-true, ii-false D) i-true, ii-true

Last Answer : A) i-false, ii-false

Description : A method name myMethod( ) that needs two integer arguments is declared as A) public void myMethod( ); B) public void myMethod(int a, int b); C) public void myMethod(int a, b); D) public int myMethod(a, b);

Last Answer : B) public void myMethod(int a, int

Description : Define a class student with int id and string name as data members and a method void SetData ( ). Accept and display the data for five students.

Last Answer : import java.io.*; class student { int id; String name; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); void SetData() { try { System.out.println("enter id and name for student"); ... (String are[]) {  student[] arr;  arr = new student[5];  int i;  for(i=0;i

Description : In Java servlet method init( ) is called ..................... times. A) 1 B) 2 C) 0 D) multiple

Last Answer : A) 1

Description : Trace the error: void main( ) { int *b, &a; *b = 20 printf(“%d, %d”, a, *b) } (A) No error (B) Logical error (C) Syntax error (D) Semantic error

Last Answer : (C) Syntax error

Description : JSP embeds in ................ in ...................... A) Servlet, HTML B) HTML, Java C) HTML, Servlet D) Java, HTML

Last Answer : D) Java, HTML

Description : Java Servlet i) is key component of server side java development ii) is a small pluggable extension to a server that enhances functionality iii) runs only in Windows Operating System iv) allows developers to customize any java ... & iv are true C) ii, iii & iv are true D) i, ii & iv are true

Last Answer : D) i, ii & iv are true

Description : Which method will a web browser call on a new applet? A) main method B) destroy method C) execute method D) init method

Last Answer : D) init method

Description : Suppose d = { john :40, peter :45}, what happens when we try to retrieve a value using the expression d[ susan ]? a) Since susan is not a value in the set, Python raises a KeyError ... Python raises a KeyError exception d) Since susan is not a key in the set, Python raises a syntax error

Last Answer : c) Since “susan” is not a key in the set, Python raises a KeyError exception

Description : A client-server system uses a satellite network, with the satellite at a height of 40,000 kms. What is the best-case delay in response to a request? (Note that the speed of light in air is 3,00,000 km/second). (A) 133.33 m sec (B) 266.67 m sec (C) 400.00 m sec (D) 533.33 m sec

Last Answer : (D) 533.33 m sec Explanation: The request has to go up and down, and the response has to go up and down. The total path length traversed is thus 160.000 km. The speed of light in air and vacuum is 300,000 km/sec, so the propagation delay alone is 160,000/300,000 sec or about 533 msec. 

Description : Give output for following code: class student { int roll no; char name [14]; } s[6]; void main() { cout<<sizeof(s); }

Last Answer : Considering roll_no(Single variable) the output is: 96 OR Considering roll, no (Two variables) the output is: 108 OR Considering roll no the output is: error – space between roll and no

Description : What would happen if "String[]args" is not included as argument in the main method. A) No error B) Compilation error C) Program won't run D) Program exit

Last Answer : C) Program won't run

Description : In Data mining, .............. is a method of incremental conceptual clustering. (A) STRING (B) COBWEB (C) CORBA (D) OLAD

Last Answer : (B) COBWEB

Description : In Java, when we implement an interface method, it must be declared as: (A) Private (B) Protected (C) Public (D) Friend

Last Answer : (C) Public

Description : Which of the following characteristics of constructor are true. i) They should be declared in the public section. ii) They are invoked automatically when the objects are created. iii) They do not have return type and void also. ... and v C) Only i, iii, iv and v D) All i, ii, iii, iv and v

Last Answer : D) All i, ii, iii, iv and v

Description : In C++, the keyword void was used ……….. A) To specify the return type of function when it is not returning any value. B) To indicate an empty argument list to a function. C) To declare the generic pointers. D) All of the above.

Last Answer : D) All of the above.

Description : Which keyword is used to raise an exception?

Last Answer : A: throw keyword.

Description : The class at the top of exception class hierarchy is .......................... A) ArithmeticException B) Throwable C) Class D) Exception

Last Answer : B) Throwable

Description : Match the following mechanisms for interrupting the execution of a process and their uses. i) Interrupt a) Call to an operating system function ii) Trap b) Reaction to an asynchronous external event iii) Supervisor Call c) Handling of a error ... -a, iii-b C) i-b, ii-c, iii-a D) i-a, ii-c, iii-b

Last Answer : C) i-b, ii-c, iii-a

Description : Process of removing errors called a) Error Free b) Debug c) Syntax Error d) Exception

Last Answer : b) Debug

Description : In C++, which system-provided function is called when no handler is provided to deal with an exception? (A) terminate() (B) unexpected() (C) abort() (D) kill()

Last Answer : Answer: A

Description : What is the basis of the Scientific Method? a. To test hypotheses in conditions that are conducive to its success b. To formulate a research problem and disprove the hypothesis c. To formulate a ... the hypothesis. d. To test hypotheses and if they are disproved, they should be abandoned completely

Last Answer : c. To formulate a research problem, test the hypothesis in carefully controlled conditions that challenge the hypothesis.

Description : Why is the ‘S’ of String capital?

Last Answer : A: Since String is a class.

Description : Which is the correct statement(s) for Non Recursive predictive parser? S1: First(α) = {t | α => * t β for some string β } => *tβ S2: Follow(X) = { a | S => * αXa β for some strings ... and S2 is correct. (C) S1 is correct and S2 is incorrect. (D) Both statements S1 and S2 are correct. 

Last Answer : (D) Both statements S1 and S2 are correct.

Description : Which of the following is FALSE ? (A) The grammar S ⟶ aSb|bSa|SS|∈, where S is the only non-terminal symbol and ∈ is the null string, is ambiguous. (B) SLR is powerful than LALR. (C) An LL(1) parser is a top-down parser. (D) YACC tool is an LALR(1) parser generator.

Last Answer : (B) SLR is powerful than LALR.

Description : In a relational database model, NULL values can be used for all but which one of the following? (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL. (B) To ... D) To fill a column in a tuple when that column does not really exist for that particular tuple.

Last Answer : (A) To allow duplicate tuples in the table by filling the primary key column(s) with NULL.

Description : What will be the output of the following segment of the program? main( ) { char *s = “hello world”; int i = 7; printf(“%, *s”, i, s); } (A) Syntax error (B) hello w (C) hello (D) o world

Last Answer : Answer: Marks given to all

Description : …………. is a program interface that enables a user to communicate with computer through graphics or symbols. -Technology

Last Answer : GUI (Graphical User Interface) is a program interface that enables a user to communicate with computer through graphics or symbols.

Description : Which of the following are the states of a five state process model? i) Running ii) Ready iii) New iv) Exit v) Destroy A) i, ii, iii and v only B) i, ii, iv and v only C) i, ii, iii, and iv only D) All i, ii, iii, iv and v

Last Answer : C) i, ii, iii, and iv only

Description : The auditor is most likely to presume that a high risk of fraud exists if a. The client is a multinational company that does business in numerous foreign countries. b. The client ... perpetrate and conceal thefts. d. Inadequate employee training results in lengthy EDP exception reports each month

Last Answer : Inadequate segregation of duties places an employee in a position to perpetrate and conceal thefts

Description : In java, string is a ............. A) primitive data type B) abstract data type C) combination of boolean D) None of the above

Last Answer : B) abstract data type

Description : If m and n are int type variables, what will be the result of the expression m% n when m=5 and n=2 ? A) 0 B) 1 C) 2 D) None of the above

Last Answer : B) 1

Description : Which command is used to change protection mode of files starting with the string emp and ending with 1,2, or 3? A. chmod u+x emp[l-3] B. chmod 777 emp* C. chmod u+r ??? emp D. chmod 222 emp? E. None of the above

Last Answer : A. chmod u+x emp[l-3]

Description : In which year did G.S. Ohm formulate Ohm’s law?

Last Answer : Answer: 1827.

Description : main() { Int a=3, b=2, c*d*e; d=&a; e=&b; c=*d+*e; } Which one of the given answers is correct? A) a=4, c-6 B) a=3, c=5 C) a=3, c=6 D) a=3, c=8

Last Answer : B) a=3, c=5

Description : `(i) int e^(x). "[log (sec x+tan x) + sec x dx "` `(ii) int (e^(-x)(cos x-sin x))/(cos^(2) x) dx`

Last Answer : `(i) int e^(x). "[log (sec x+tan x) + sec x dx "` `(ii) int (e^(-x)(cos x-sin x))/(cos^(2) x) dx`

Description : `int " log"_(e) " x dx "`

Last Answer : `int " log"_(e) " x dx "`

Description : `int((log _(e)x)^(3))/(x)dx`

Last Answer : `int((log _(e)x)^(3))/(x)dx`

Description : In what way is a file more flexible than a String?

Last Answer : Ans: A file is stored permanently in a storage device.It is easy to access a file whenever required. On the other hand, a string is stored temporarily in RAM, and the contents of a string will be erased automatically when the power is switched off or when the program execution is terminated.

Description : Is it compulsory to write String args[] when running a program in BlueJ?

Last Answer : A: No it is not compulsory when we are running it in BlueJ. But normally (in all other cases) it is always better to have it, as the JVM looks for the main method with a String array as a parameter.

Description : Which command is used to concatenate all files beginning with the string 'emp' and followed by a non-numeric characters? A. cat emp[!0-9] B. more [emp][!0-9] C. cat emp[x-z]

Last Answer : A. cat emp[!0-9]

Description : Which command is used to copy all files having the string chap and any two characters after that to the progs directory? A. cp chap?? progs B. cp chap* progs C. cp chap[12] /progs/*.*

Last Answer : A. cp chap?? progs

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : The class string belongs to ................... package. A) java.awt B) java.lang C) java.applet D) java.string

Last Answer : B) java.lang

Description : ………… function writes a string of text to a window. A) cputs () B) put () C) gets () D) tputs ()

Last Answer : A) cputs ()

Description : The ..................... is essentially used to search for patterns in target string. A) Like Predicate B) Null Predicate C) In Predicate D) Out Predicate

Last Answer : A) Like Predicate

Description : Data items grouped together for storage purposes are called a A) record B) title C) list D) string

Last Answer : A) record

Description : To remove string “hello” from list1, we use which command ? a) list1.remove(“hello”) b) list1.remove(hello) c) list1.removeAll(“hello”) d) list1.removeOne(“hello”)

Last Answer : d) list1.removeOne(“hello”)