

MCQOPTIONS
Saved Bookmarks
This section includes 1671 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
151. |
Abbreviate the term MIME? |
A. | Multilevel internet Mail Extension |
B. | Multipurpose internet Mail Extension |
C. | Multiuse information Mail Extension |
D. | None of the above |
Answer» C. Multiuse information Mail Extension | |
152. |
Which method of the servlet is/are called several times in its life? |
A. | init() |
B. | doPost() |
C. | destroy() |
D. | Both (a) and (b) above |
Answer» C. destroy() | |
153. |
Stateful Session beans contain |
A. | Home Interface |
B. | Remote Interface |
C. | Bean class |
D. | All of the above |
Answer» E. | |
154. |
Which of the following syntax is correct to refer an external script called “formValidation.js”? |
A. | <script href = “formValidation.js”> |
B. | <script source = “formValidation.js”> |
C. | <script name = “formValidation.js”> |
D. | <script src = “formValidation.js”> |
Answer» E. | |
155. |
Which of the following is correct to write “Hello World ” on the web page? |
A. | System.out.println(“Hello World”) |
B. | print(“Hello World”) |
C. | document.write(“Hello World”) |
D. | response.write(“Hello World”) |
Answer» D. response.write(“Hello World”) | |
156. |
What are the contents of web module? |
A. | JSP files |
B. | Java classes |
C. | Gif and Html files and |
D. | Web component deployment descriptors |
Answer» B. Java classes | |
157. |
Which of the following is not a life-cycle method for a Stateful Session Bean? |
A. | Post Construction |
B. | Pre Destruction |
C. | Post Activation |
D. | Pre Construction |
Answer» E. | |
158. |
When might your program wish to run the garbage collecter? |
A. | Before it enters a compute-intense section of code |
B. | Before it enters a memory-intense section of code |
C. | When it knows there will be some idle time |
D. | All of above |
Answer» E. | |
159. |
Upon invoking getRollbackOnly() method by a business method in an entity bean, which transaction attribute settings will lead the ejb container to throw an exception? |
A. | Required |
B. | RequiresNew |
C. | Never |
D. | Mandatory |
Answer» D. Mandatory | |
160. |
Give the examples of Application Server from the following? |
A. | Apache |
B. | JBoss |
C. | Weblogic |
D. | Both B & C |
Answer» E. | |
161. |
EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence. |
A. | True |
B. | False |
C. | none |
D. | all |
Answer» B. False | |
162. |
Which of the following is true for JNDI? |
A. | Database service |
B. | Naming and Directory Service |
C. | Network Service |
D. | Web Service |
Answer» C. Network Service | |
163. |
The getSession() method with ‘true’ as its parameter [ getSession(true)] it will return the appropriate session object when |
A. | the session is completed |
B. | the session object is passed to another method |
C. | the session does not exists |
D. | the session is existing |
Answer» E. | |
164. |
What is a compilation unit? |
A. | Java Byte code |
B. | Java source code file |
C. | Source code |
D. | Java Exe |
Answer» C. Source code | |
165. |
Which statement about life-cycle callback methods is correct? |
A. | Life-cycle callback methods must be implemented in the bean class. |
B. | Life-cycle callback methods can have public, private, protected, or packagelevel access. (*) |
C. | A life-cycle callback method can only have a single callback annotation. In other words, you cannot define a single method and give it two different callback annotations. |
D. | Life-cycle callback methods can be declared as static. |
Answer» C. A life-cycle callback method can only have a single callback annotation. In other words, you cannot define a single method and give it two different callback annotations. | |
166. |
What's the difference between servlets and applets? 1. Servlets executes on Servers, where as Applets executes on Browser 2. Servlets have no GUI, where as an Applet has GUI 3. Servlets creates static web pages, where as Applets creates dynamic web pages 4. Servlets can handle only a single request, where as Applet can handle multiple requests |
A. | 1,2,3 are correct |
B. | 1,2 are correct |
C. | 1,3 are correct |
D. | 1,2,3,4 are correct |
Answer» C. 1,3 are correct | |
167. |
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» B. JSP Standard Tag Library | |
168. |
Which of the following is not a valid JavaScript variable name? |
A. | 2java |
B. | _java_and_java_names |
C. | Javaandjava |
D. | None of the above |
Answer» B. _java_and_java_names | |
169. |
What is the purpose of |
A. | Prevents scripts on the page from executing. |
B. | Enclose text to be displayed by non –JavaScript browsers. |
C. | Suppresses the result to be displayed on the web page. |
D. | None of the above. |
Answer» C. Suppresses the result to be displayed on the web page. | |
170. |
JSP pages have access to implicit objects that are exposed automatically. Name the implicit object that is of type HttpSession. |
A. | session |
B. | application |
C. | httpSession |
D. | httpsession |
Answer» B. application | |
171. |
The life cycle of session bean is not maintained by the application server (EJB Container). |
A. | True |
B. | False |
C. | none |
D. | all |
Answer» C. none | |
172. |
Which of the following is not a property of EJB transaction? |
A. | Atomicity |
B. | Consistency |
C. | Isolation |
D. | Distributed |
Answer» E. | |
173. |
In Java, for ensuring the persistence property, the class must implements: |
A. | Serializable Interface |
B. | Utilization Interface |
C. | Threadable Interface |
D. | Recognizable Interface |
Answer» B. Utilization Interface | |
174. |
Parent class of all java classes is ______ |
A. | Java.lang.system |
B. | Java.lang.object |
C. | Java.lang.class |
D. | Java.lang,reflect.object |
Answer» C. Java.lang.class | |
175. |
In C++, which of the following methods contained in the exception handling mechanism in a program fails to find a matching catch block for a raised exception? |
A. | unexpected() |
B. | terminate() |
C. | null() |
D. | default() |
Answer» B. terminate() | |
176. |
A condition that is caused by run-time error in a computer program is known as: |
A. | Syntax error |
B. | Fault |
C. | Semantic error |
D. | Exception |
Answer» E. | |
177. |
Consider the following Java code fragment. Which of the following statement is true?Line NoCode Statement1public class While2{3 public void loop()4 {5 int x = 0;6 while (1)7 {8System.out.println(“x plus one is” + (x + 1));9 }10 }11} |
A. | There is syntax error in line no. 1 |
B. | There are syntax errors in line nos. 1 & 6 |
C. | There is syntax error in line no. 8 |
D. | There is syntax error in line no. 6 |
Answer» E. | |
178. |
Java is a _________ language. This means that you must be explicit about what type of data you are working with. |
A. | Strongly typed |
B. | Loosely typed |
C. | Dynamically typed |
D. | Weakly typed |
Answer» B. Loosely typed | |
179. |
Consider the following Java code segment:public class while /*line1*/{public void loop(){int x=0;while(1) /*line 6*/{System.out.println(“x plus one is” + (x + 1));}}}Which of the following is true? |
A. | There is a syntax error in line -1 |
B. | There are syntax errors in, line -1 and line -6 |
C. | There is a syntax error in line -6 |
D. | No syntax error |
Answer» B. There are syntax errors in, line -1 and line -6 | |
180. |
In java, which layout manager preserves the width and height of the components? |
A. | FlowLayout |
B. | BorderLayout |
C. | BoxLayout |
D. | GridLayout |
Answer» D. GridLayout | |
181. |
In context of Java Graphics, a geometric object can be titled horizontally using the following? |
A. | scale () |
B. | translate () |
C. | rotate () |
D. | shear () |
Answer» E. | |
182. |
Additional information sent when an exception is thrown may be placed in ______ |
A. | The throw keyword |
B. | The function that caused the error |
C. | The catch block |
D. | An object of the exception class |
Answer» D. An object of the exception class | |
183. |
In the given Program:class Dialog1{public static void main(String args[]){Frame f1 = new Frame("INDIA");f1.setSize(300,300);f1.setVisible(true);FileDialog d = new FileDialog(f1, "MyDialog");d.setVisible(true);String fname = d.getDirectory() + d.getFile();System.out.println("The Selection is" + fname);}}To make the Frame visible, which of the following statements are true? |
A. | f1.setClear(true); |
B. | f1.setVisible(true); |
C. | f1.setlook(true); |
D. | f1.setclean(true); |
Answer» C. f1.setlook(true); | |
184. |
In context of Java Threads, which of the following statements are true?I: sleep () and yield () are static methods in thread classII: yield () voluntarily relinquishes CPU to other threads.III: Daemon will terminate when all non-Daemon threads terminate. |
A. | I, II and III |
B. | I and II only |
C. | II and III only |
D. | I and III only |
Answer» B. I and II only | |
185. |
If a variable or operand in an expression is type long, then all the operands are type promoted to which data type? |
A. | int |
B. | long |
C. | float |
D. | double |
Answer» C. float | |
186. |
A boolean literal in Java can be type casted to which data type? |
A. | byte |
B. | short |
C. | int |
D. | None of the above |
Answer» E. | |
187. |
In a lossy Type Casting or Type Conversion, how is the number truncated to the target data type in Java? |
A. | That big number is divided by the target data type highest possible number say 2^N. |
B. | That big number is Modulo Divided by the target data type highest possible number say 2^N and the Remainder is taken. |
C. | That big number is Modulo Divided by the target data type highest possible number say 2^N and the Quotient is taken. |
D. | None of the above |
Answer» C. That big number is Modulo Divided by the target data type highest possible number say 2^N and the Quotient is taken. | |
188. |
What is the output of the following Java Code? |
A. | 4.0 |
B. | 4.5 |
C. | 5.0 |
D. | None of the above |
Answer» B. 4.5 | |
189. |
Which are the compatible Data Types for Type Promotion or Type Casting? |
A. | byte, char, short |
B. | char, int, float |
C. | float, long, double |
D. | All the above |
Answer» E. | |
190. |
Implicit Type Conversion in Java is also called ___? |
A. | Narrowing Type Conversion |
B. | Widening Type Conversion |
C. | No Type Conversion |
D. | None of the above |
Answer» C. No Type Conversion | |
191. |
Explicit Type Conversion in Java refers to ___? |
A. | Narrowing Type Conversion |
B. | Widening Type Conversion |
C. | No Type Conversion |
D. | None of the above |
Answer» B. Widening Type Conversion | |
192. |
Type Casting in Java usually refers to ____? |
A. | Narrowing Type Conversion |
B. | Widening Type Conversion |
C. | No Type Conversion |
D. | None of the above |
Answer» B. Widening Type Conversion | |
193. |
Type promotion in Java usually refers to ____. |
A. | Narrowing Type Conversion |
B. | Widening Type Conversion |
C. | No Type Conversion |
D. | None of the above |
Answer» C. No Type Conversion | |
194. |
What is the result of a Widening Type Conversion in Java? |
A. | Loss of data |
B. | Gain of data |
C. | No change |
D. | None of the above |
Answer» D. None of the above | |
195. |
What is the result of a Narrowing type conversion? |
A. | Loss of data |
B. | Addition of data |
C. | Corruption of data |
D. | None of the above |
Answer» B. Addition of data | |
196. |
What is a Narrowing Type Conversion in Java? |
A. | Conversion of data from lower data type to higher data type |
B. | Conversion data from a higher data type to a lower data type |
C. | Conversion of data from any data type to any data type |
D. | None of the above |
Answer» C. Conversion of data from any data type to any data type | |
197. |
What is a Widening Type Conversion in Java? |
A. | Conversion of data from higher data type to lower data type |
B. | Conversion of data from lower data type to higher data type |
C. | Conversion of data from any data type to any data type |
D. | None of the above |
Answer» C. Conversion of data from any data type to any data type | |
198. |
What is a higher data type in Java language? |
A. | A data type which holds more data than other data types |
B. | A data type whose size is more than other data types |
C. | A data type which can hold more precision digits than other data types |
D. | All the above |
Answer» E. | |
199. |
What are the Type Conversions available in Java language? |
A. | Narrowing Type Conversion |
B. | Widening Type Conversion |
C. | A and B |
D. | None of the above |
Answer» D. None of the above | |
200. |
Among Relational operators and Assignment operators, which operators have higher priority? |
A. | Assignment operators have lower priority than Relational operators |
B. | Assignment operators have higher priority than Relational operators |
C. | Assignment operators have equal priority with Relational operators |
D. | None of the above |
Answer» B. Assignment operators have higher priority than Relational operators | |