On Java | More Q&A Click Here
# | Question | Options | Answer |
---|---|---|---|
1 | Which of those doesn’t have an index based structure? | Set | |
2 | java.util.Collections is a: | Class | |
3 | Methods such as reverse, shuffle are offered in: | Collections | |
4 | Which of those allows duplicate elements? | List | |
5 | Which allows the storage of a null key and null values? | HashMap | |
6 | Which interface should be implemented for sorting on basis of many criteria’s? | Comparator | |
7 | What guarantees type-safety in a collection? | Generics | |
8 | The most used interfaces from the collection framework are? | Map | |
9 | The root interface of Java collection framework hierarchy is – | List/Set | |
10 | Which of those is synchronized? | Vector | |
11 | ArrayList implements that of the following? | All of these | |
12 | Which of those permits the storage of the many null values? | All of these | |
13 | Which doesn’t permit to store a null value? | TreeSet | |
14 | TreeMap implements? | Navigable Map | |
15 | Which of these standard collection classes implements a dynamic array? | ArrayList | |
16 | Which of these method of ArrayList class is used to obtain present size of an object? | size() | |
17 | Which of the below does not implement Map interface? | Vector | |
18 | How to externally synchronize hashmap? | Collections.synchronizedMap(new HashMap()); | |
19 | How can we remove an object from ArrayList? | remove() method and using Iterator | |
20 | Which class provides thread safe implementation of List? | CopyOnWriteArrayList | |
21 | What is the relation between hashset and hashmap? | HashSet internally implements HashMap | |
22 | Which of these object stores association between keys and values? | Map | |
23 | Which of these classes provide implementation of map interface? | HashMap | |
24 | Which of these methods can be used to obtain set of all keys in a map? | keySet() | |
25 | Which of these are legacy classes? | All of the mentioned | |
26 | Which of the following is not OOPS concept in Java? | Compilation | |
27 | When does method overloading is determined? | At compile time | |
28 | When Overloading does not occur? | More than one method with same name, same number of parameters and type but different signature | |
29 | Which concept of Java is a way of converting real world objects in terms of class? | Abstraction | |
30 | Which concept of Java is achieved by combining methods and attribute into a class? | Encapsulation | |
31 | What is it called where child object gets killed if parent object is killed? | Composition | |
32 | Which component is used to compile, debug and execute java program? | JDK | |
33 | Which component is responsible for converting bytecode into machine specific code? | JVM | |
34 | Which component is responsible to run java program? | JRE | |
35 | Which component is responsible to optimize bytecode to machine code? | JIT | |
36 | Which of the below is invalid identifier with the main method? | private | |
37 | What is use of interpreter? | They read high level code and execute them | |
38 | Which of the following is a valid declaration of an object of class Box? | Box obj = new Box(); | |
39 | Which of these operators is used to allocate memory for an object? | new | |
40 | Which of the following statements is correct? | Public method is accessible to all other classes in the hierarchy | |
41 | What is the process of defining more than one method in a class differentiated by method signature? | Method overloading | |
42 | Which of the following is a method having same name as that of it’s class? | constructor | |
43 | Which method can be defined only once in a program? | main method | |
44 | Which keyword is used by the method to refer to the object that invoked it? | this | |
45 | Which function is used to perform some action when the object is to be destroyed? | finalize() | |
46 | What is false about constructor? | Constructor can have a return type | |
47 | Which of these access specifier must be used for class so that it can be inherited by another subclass? | public | |
48 | What is the process by which we can control what parts of a program can access the members of a class? | Encapsulation | |
49 | Which of these is used as default for a member of a class if no access specifier is used for it? | private | |
50 | What is use of interpreter? | They read high level code and execute them | |
51 | What is the extension of compiled java classes? | .class | |
52 | Which of the below is invalid identifier with main method? | private | |
53 | Which of these package is used for text formatting in Java programming language? | java.text | |
54 | Which environment variable is used to set java path? | JAVA_HOME | |
55 | Which of these can not be used for a variable name in Java? | keyword | |
56 | Literals in java must be appended by which of these? | L and I | |
57 | What is true of final class? | Final class cannot be inherited | |
58 | All the variables of interface should be ? | public,static and final | |
59 | How can a protected modifier be accessed? | accessible within package and outside the package but through inheritance only | |
60 | Which of the following modifier means a particular variable cannot be accessed within the package? | private | |
61 | All the variables of class should be ideally declared as ? | private | |
62 | Which one of the following is not an access modifier? | Void | |
63 | Which of the following is not a valid flow control statement? | exit() | |
64 | What is true about do statement? | do statement executes the code of a loop at least once | |
65 | Which of the following loops will execute the body of loop even when condition controlling the loop is initially false? | do-while | |
66 | Which of these method of class StringBuffer is used to find the length of current character sequence? | length() | |
67 | Which of these method of class String is used to remove leading and trailing whitespaces? | trim() | |
68 | Which of this method of class String is used to extract a substring from a String object? | substring() | |
69 | Which of these method of class String is used to compare two String objects for their equality? | equals() | |
70 | Which of these is an incorrect statement? | StringBuffer class is used to store string in a buffer for later use | |
71 | Which of this method of class String is used to obtain a length of String object? | length() | |
72 | Which of these methods can be used to search an element in a list? | binaryserach() | |
73 | Which of these cannot be declared static? | object | |
74 | Which of these keywords is used to prevent content of a variable from being modified? | final | |
75 | Arrays in Java are implemented as? | object | |
76 | Where is array stored in memory? | heap space | |
77 | Can you make an array volatile? | True | |
78 | Which of these is an incorrect Statement? | It is necessary to use new operator to initialize an array. | |
79 | Which of these classes is super class of Exception class? | Throwable | |
80 | Which of these methods return description of an exception? | getMessage() | |
81 | Which of these statements is incorrect? | try need not to be followed by anything | |
82 | Which of these keywords are used for generating an exception manually? | throw | |
83 | Which of these keywords are used for the block to handle the exceptions generated by try block? | catch | |
84 | Which of these keywords are used for the block to be examined for exceptions? | try | |
85 | What is the use of try and catch? | All of Above | |
86 | Which of these exceptions will occur if we try to access the index of an array beyond its length? | ArrayIndexOutOfBoundsException | |
87 | A single try block must be followed by which of these? | finally & catch | |
88 | Which of these clause will be executed even if no exceptions are found? | finally | |
89 | Which of these class is related to all the exceptions that are explicitly thrown? | Throwable | |
90 | Which of these keywords is used to generate an exception explicitly? | throw | |
91 | What exception thrown by parseInt() method? | NumberFormatException | |
92 | Which of these handles the exception when no catch is used? | Default handler | |
93 | Which of these class is related to all the exceptions that cannot be caught? | Error | |
94 | Which part of code gets executed whether exception is caught or not? | finally | |
95 | Which of the following keywords is used for throwing exception manually? | throw | |
96 | What would be the result if a class extends two interfaces and both have a method with same name and signature? | Compile time error | |
97 | Which of the following is used for implementing inheritance through class? | extends | |
98 | Which of the following is used for implementing inheritance through an interface? | implements | |
99 | Static members are not inherited to subclass. | False | |
100 | If super class and subclass have same variable name, which keyword should be used to use super class? | super | |
101 | In order to restrict a variable of a class from inheriting to subclass, how variable should be declared? | Private | |
102 | All classes in Java are inherited from which class? | java.lang.Object | |
103 | Using which of the following, multiple inheritance in Java can be implemented? | Interfaces | |
104 | Which of this keyword must be used to inherit a class? | extends | |
105 | Which of these is supported by method overriding in Java? | Polymorphism | |
106 | If a class inheriting an abstract class does not define all of its function then it will be known as? | Abstract | |
107 | Which of these is not abstract? | Thread | |
108 | Which of this package is used for handling security related issues in a program? | java.security | |
109 | Which of these methods can randomize all elements in a list? | shuffle() | |
110 | Which of these must contain a unique element? | Set | |
111 | Which of these interface handle sequences? | List | |
112 | Which of these is a method of ListIterator used to obtain index of previous element? | previousIndex() | |
113 | Which of these methods can be used to move to next element in a collection? | next() | |
114 | Which of these return type of hasNext() method of an iterator? | Boolean | |
115 | What is Collection in Java? | A group of objects | |
116 | Which of these methods deletes all the elements from invoking collection? | clear() | |
117 | Which of these classes is not part of Java’s collection framework? | Maps | |
118 | Which of these packages contain all the collection classes? | java.util | |
119 | Which of these methods is used to retrieve the elements in properties object at specific location? | getProperty() | |
120 | Which of these method is used to insert value and its key? | put() | |
121 | Which of these class object uses the key to store value? | All of above | |
122 | Which of these methods is used to add elements in vector at specific location? | addElement() | |
123 | Which of these are legacy classes? | All of Above | |
124 | Which of these methods can be used to obtain set of all keys in a map? | keySet() | |
125 | Which of these method is used to remove all keys/values pair from the invoking map? | remove() | |
126 | Which of the following is not OOPS concept in Java? | Compilation | |
127 | Which of the following is a type of polymorphism in Java? | Compile time polymorphism | |
128 | When does method overloading is determined? | At compile time | |
129 | When Overloading does not occur? | More than one method with same name, same number of parameters and type but different signature | |
130 | Which concept of Java is a way of converting real world objects in terms of class? | Abstraction | |
131 | Which concept of Java is achieved by combining methods and attribute into a class? | Encapsulation | |
132 | What is it called if an object has its own lifecycle and there is no owner? | Association | |
133 | What is it called where child object gets killed if parent object is killed? | Composition | |
134 | What is it called where object has its own lifecycle and child object cannot belong to another parent object? | Aggregation | |
135 | Method overriding is combination of inheritance and polymorphism? | True | |
136 | What is the stored in the object obj in following lines of Java code? -> box obj; | NULL | |
137 | Which of these keywords is used to make a class? | class | |
138 | Which of the following is a valid declaration of an object of class Box? | Box obj = new Box(); | |
139 | Which of these statement is incorrect? | Every class must contain a main() method | |
140 | Which of the following statements is correct? | Public method is accessible to all other classes in the hierarchy | |
141 | What is the return type of a method that does not return any value? | void | |
142 | Which of the following is a method having same name as that of it’s class? | constructor | |
143 | Which method can be defined only once in a program? | main method | |
144 | Which of this statement is incorrect? | All object of a class are allotted memory for the methods defined in the class | |
145 | What is the return type of Constructors? | none of the mentioned | |
146 | Which keyword is used by the method to refer to the object that invoked it? | this | |
147 | Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed? | none of the mentioned | |
148 | Which function is used to perform some action when the object is to be destroyed? | finalize() | |
149 | Which of the following statements are incorrect? | finalize() method is called when a object goes out of scope and is no longer needed | |
150 | What is true about private constructor? | Private constructor ensures only one instance of a class exist at any point of time | |
151 | What would be the behaviour if this() and super() used in a method? | compile time error | |
152 | What is false about constructor? | Constructor can have a return type | |
153 | What is true about Class.getInstance()? | Class.getInstance creates object if class does not have any constructor | |
154 | What is true about protected constructor? | Protected constructor can only be called using super() | |
155 | What is not the use of this keyword in Java? | Passing itself to method of the same class | |
156 | What would be the behaviour if one parameterized constructor is explicitly defined? | Compilation succeeds but at the time of creating object using default constructor, it throws compilation error | |
157 | What would be behaviour if the constructor has a return type? | Compilation error | |
158 | What is the process of defining two or more methods within same class that have same name but different parameters declaration? | method overloading | |
159 | Which of these can be overloaded? | All of the mentioned | |
160 | Which of these is correct about passing an argument by call-by-value process? | Copy of argument is made into the formal parameter of the subroutine | |
161 | What is the process of defining a method in terms of itself, that is a method that calls itself? | Recursion | |
162 | Which of these access specifiers must be used for main() method? | public | |
163 | Which of these is used to access a member of class before object of that class is created? | static | |
164 | Which of these is used as a default for a member of a class if no access specifier is used for it? | private | |
165 | What is the process by which we can control what parts of a program can access the members of a class? | Encapsulation | |
166 | Which of the following statements are incorrect? | private members of class can be inherited by a subclass, and become protected members in subclass | |
167 | Which of these access specifier must be used for class so that it can be inherited by another subclass? | public | |
168 | Which one of the following is not an access modifier? | Void | |
169 | All the variables of class should be ideally declared as? | private | |
170 | Which of the following modifier means a particular variable cannot be accessed within the package? | private | |
171 | How can a protected modifier be accessed? | accessible within package and outside the package but through inheritance only | |
172 | What happens if constructor of class A is made private? | Objects of class A can be instantiated only within the class where it is declared | |
173 | All the variables of interface should be? | public, static and final | |
174 | What is true of final class? | Final class cannot be inherited | |
175 | How many copies of static and class variables are created when 10 objects are created of a class? | 1, 10 | |
176 | Which is the modifier when there is none mentioned explicitly? | default | |
177 | String in Java is a? | class | |
178 | Which of these method of String class is used to obtain character at specified index? | charAt() | |
179 | Which of these keywords is used to refer to member of base class from a subclass? | super | |
180 | Which of these method of String class can be used to test to strings for equality? | equals() | |
181 | Which of the following statements are incorrect? | Strings in java are mutable | |
182 | Which of this keyword can be used in a subclass to call the constructor of superclass? | super | |
183 | What is the process of defining a method in a subclass having same name & type signature as a method in its superclass? | Method overriding | |
184 | Which of these keywords can be used to prevent Method overriding? | final | |
185 | Which of these is supported by method overriding in Java? | Polymorphism | |
186 | What is not type of inheritance? | Double inheritance | |
187 | Using which of the following, multiple inheritance in Java can be implemented? | Interfaces | |
188 | All classes in Java are inherited from which class? | java.lang.Object | |
189 | In order to restrict a variable of a class from inheriting to subclass, how variable should be declared? | Private | |
190 | If super class and subclass have same variable name, which keyword should be used to use super class? | super | |
191 | Static members are not inherited to subclass. | True | |
192 | Which of the following is used for implementing inheritance through an interface? | implements | |
193 | Which of the following is used for implementing inheritance through class? | extends | |
194 | What would be the result if a class extends two interfaces and both have a method with same name and signature? Lets assume that the class is not implementing that method. | Compile time error | |
195 | Which of these class is superclass of every class in Java? | Object class | |
196 | Which of these method of Object class can clone an object? | Object clone() | |
197 | Which of these method of Object class is used to obtain class of an object at run time? | Class getclass() | |
198 | Which of these keywords can be used to prevent inheritance of a class? | final | |
199 | Which of these keywords cannot be used for a class which has been declared final? | abstract | |
200 | Which of these class relies upon its subclasses for complete implementation of its methods? | abstract class | |
201 | Which of these keywords are used to define an abstract class? | abstract | |
202 | Which of these is not abstract? | Thread | |
203 | If a class inheriting an abstract class does not define all of its function then it will be known as? | Abstract | |
204 | Which of these is not a correct statement? | Abstract class can be initiated by new operator | |
205 | Which of these packages contains abstract keyword? | java.lang | |
206 | Which of these class is superclass of String and StringBuffer class? | java.lang | |
207 | Which of these operators can be used to concatenate two or more String objects? | + | |
208 | Which of this method of class String is used to obtain a length of String object? | length() | |
209 | Which of these constructors is used to create an empty String object? | String() | |
210 | Which of these is an incorrect statement? | StringBuffer class is used to store string in a buffer for later use | |
211 | Which of this method of class String is used to extract a substring from a String object? | substring() | |
212 | Which of these method of class String is used to remove leading and trailing whitespaces? | trim() | |
213 | What is the value returned by function compareTo() if the invoking string is greater than the string compared? | value greater than zero | |
214 | Which of the following statement is correct? | replace() method replaces all occurrences of one character in invoking string with another character | |
215 | Which of these method of class String is used to compare two String objects for their equality? | equals() | |
216 | Which of these methods is used to compare a specific region inside a string with another specific region in another string? | regionMatches() | |
217 | Which of these methods of class String is used to check whether a given object starts with a particular string literal? | startsWith() | |
218 | What is the value returned by function compareTo() if the invoking string is less than the string compared? | value less than zero | |
219 | Which of these data type value is returned by equals() method of String class? | boolean | |
220 | Which of these class is used to create an object whose character sequence is mutable? | StringBuffer() | |
221 | Which of this method of class StringBuffer is used to concatenate the string representation to the end of invoking string? | append() | |
222 | Which of these method of class StringBuffer is used to find the length of current character sequence? | length() | |
223 | Which of the following statement is correct? | reverse() method reverses all characters | |
224 | Which of these methods of class StringBuffer is used to extract a substring from a String object? | substring() | |
225 | Which of this method of class StringBuffer is used to reverse sequence of characters? | reverse() | |
226 | Which of this method of class StringBuffer is used to get the length of the sequence of characters? | length() | |
227 | Which of these is a process of writing the state of an object to a byte stream? | Serialization | |
228 | Which of these process occur automatically by the java runtime system? | Serialization | |
229 | Which of these is an interface for control over serialization and deserialization? | Externalization | |
230 | Which of these interface extends DataOutput interface? | ObjectOutput | |
231 | Which of these is a method of ObjectOutput interface used to finalize the output state so that any buffers are cleared? | flush() | |
232 | Which of these is method of ObjectOutput interface used to write the object to input or output stream as required? | writeObject() | |
233 | Which of these is a process of extracting/removing the state of an object from a stream? | Deserialization | |
234 | Which of these process occur automatically by java run time system? | All of the mentioned | |
235 | Which of these interface extends DataInput interface? | ObjectInput | |
236 | Which of these class extend InputStream class? | ObjectInputStream | |
237 | How an object can become serializable? | If a class or any superclass implements java.io.Serializable interface | |
238 | What is serialization? | Turning object in memory into stream of bytes | |
239 | What is deserialization? | Turning stream of bytes into an object in memory | |
240 | How many methods Serializable has? | 0 | |
241 | What type of members are not serialized? | Static | |
242 | If member does not implement serialization, which exception would be thrown? | NotSerializableException | |
243 | Which of the following methods is used to avoid serialization of new class whose super class already implements Serialization? | writeObject() | |
244 | Which of the following methods is not used while Serialization and DeSerialization? | readWriteObject() | |
245 | Which of these package contains classes and interfaces for networking? | java.net | |
246 | Which of these is a protocol for breaking and sending packets to an address across a network? | TCP/IP | |
247 | How many ports of TCP/IP are reserved for specific protocols? | 1024 | |
248 | How many bits are in a single IP address? | 32 | |
249 | Which of these is a full form of DNS? | Domain Name Service | |
250 | Which of these class is used to encapsulate IP address and DNS? | InetAddress | |
251 | Which of these interface abstractes the output of messages from httpd? | LogMessage | |
252 | Which of these class is used to create servers that listen for either local or remote client programs? | ServerSockets | |
253 | Which of these is a standard for communicating multimedia content over email? | Mime | |
254 | Which of these methods is used to make raw MIME formatted string? | parse() | |
255 | Which of these class is used for operating on request from the client to the server? | httpd | |
256 | Which of these method of MimeHeader is used to return the string equivalent of the values stores on MimeHeader? | toString() | |
257 | Which of these is an instance variable of class httpd? | All of the mentioned | |
258 | Which of these methods of httpd class is used to read data from the stream? | getRawRequest() | |
259 | Which of these method of httpd class is used to get report on each hit to HTTP server? | logEntry() | |
260 | Which of these methods are used to find a URL from the cache of httpd? | serveFromCache() | |
261 | Which of these variables stores the number of hits that are successfully served out of cache? | hits.to.cache | |
262 | Which of these method of httpd class is used to write UrlCacheEntry object into local disk? | writeDiskCache() | |
263 | Which of these method is used to start a server thread? | run() | |
264 | Which of these method is called when http daemon is acting like a normal web server? | handleGet() | |
265 | Which of these standard collection classes implements a dynamic array? | ArrayList | |
266 | Which of these class can generate an array which can increase and decrease in size automatically? | ArrayList() | |
267 | Which of these method of ArrayList class is used to obtain present size of an object? | size() | |
268 | Which of these methods can be used to obtain a static array from an ArrayList object? | toArray() | |
269 | Which of these method is used to reduce the capacity of an ArrayList object? | trimToSize() | |
270 | Map implements collection interface? | False | |
271 | Which of the below does not implement Map interface? | Vector | |
272 | What is the premise of equality for IdentityHashMap? | Reference equality | |
273 | What happens if we put a key object in a HashMap which exists? | The new object replaces the older object | |
274 | If two threads access the same hashmap at the same time, what would happen? | ConcurrentModificationException | |
275 | If large number of items are stored in hash bucket, what happens to the internal structure? | The bucket will switch from LinkedList to BalancedTree | |
276 | How can we remove an object from ArrayList? | remove() method and using Iterator | |
277 | How to sort elements of ArrayList? | Collections.sort(listObj); | |
278 | When two threads access the same ArrayList object what is the outcome of the program? | ConcurrentModificationException is thrown | |
279 | How is Arrays.asList() different than the standard way of initialising List? | Arrays.asList() returns a fixed length list and doesn’t allow to add or remove elements | |
280 | What is the difference between length() and size() of ArrayList? | length() returns the capacity of ArrayList and size() returns the actual number of elements stored in the list | |
281 | Which class provides thread safe implementation of List? | CopyOnWriteArrayList | |
282 | Which of the below is not an implementation of List interface? | SessionList | |
283 | What does Collections.emptySet() return? | Immutable Set | |
284 | What is the relation between hashset and hashmap? | HashSet internally implements HashMap | |
285 | What is the difference between TreeSet and SortedSet? | SortedSet is an interface; TreeSet is a concrete class | |
286 | What happens if two threads simultaneously modify TreeSet? | ConcurrentModificationException is thrown | |
287 | What is the unique feature of LinkedHashSet? | It maintains the insertion order and guarantees uniqueness | |
288 | Which of these standard collection classes implements a linked list data structure? | LinkedList | |
289 | Which of these classes implements Set interface? | HashSet | |
290 | Which of these method is used to add an element to the start of a LinkedList object? | addFirst() | |
291 | Which of these method of HashSet class is used to add elements to its object? | add() | |
292 | Which of these methods can be used to delete the last element in a LinkedList object? | removeLast() | |
293 | Which of this method is used to change an element in a LinkedList Object? | set() | |
294 | Which of these object stores association between keys and values? | Map | |
295 | Which of these classes provide implementation of map interface? | HashMap | |
296 | Which of these method is used to remove all keys/values pair from the invoking map? | remove() | |
297 | Which of these method Map class is used to obtain an element in the map having specified key? | get() | |
298 | Which of these methods can be used to obtain set of all keys in a map? | keySet() | |
299 | Which of these method is used add an element and corresponding key to a map? | put() | |
300 | Which of these class object can be used to form a dynamic array? | ArrayList & Vector | |
301 | Which of these are legacy classes? | All of the mentioned | |
302 | Which of these is the interface of legacy? | Enumeration | |
303 | What is the name of a data member of class Vector which is used to store a number of elements in the vector? | elementCount | |
304 | Which of these methods is used to add elements in vector at specific location? | addElement() | |
305 | Which of these class object has an architecture similar to that of array? | Bitset | |
306 | Which of these method is used to make a bit zero specified by the index? | clear() | |
307 | Which of these method is used to calculate number of bits required to hold the BitSet object? | length() | |
308 | Which of these packages contain all the collection classes? | java.util | |
309 | Which of these classes is not part of Java’s collection framework? | Maps | |
310 | Which of this interface is not a part of Java’s collection framework? | SortedList | |
311 | Which of these methods deletes all the elements from invoking collection? | clear() | |
312 | What is Collection in Java? | A group of objects | |
313 | Which of these return type of hasNext() method of an iterator? | Boolean | |
314 | Which of these methods is used to obtain an iterator to the start of collection? | iterator() | |
315 | Which of these methods can be used to move to next element in a collection? | next() | |
316 | Which of these iterators can be used only with List? | ListIterator | |
317 | Which of these is a method of ListIterator used to obtain index of previous element? | previousIndex() | |
318 | Which of these exceptions is thrown by remover() method? | IllegalStateException | |
319 | When does Exceptions in Java arises in code sequence? | Run Time | |
320 | Which of these keywords is not a part of exception handling? | thrown | |
321 | Which of these keywords must be used to monitor for exceptions? | try | |
322 | Which of these keywords must be used to handle the exception thrown by try block in some rational manner? | catch | |
323 | Which of these keywords is used to manually throw an exception? | throw | |
324 | Which of the following keywords is used for throwing exception manually? | throw | |
325 | Which of the following classes can catch all exceptions which cannot be caught? | Error | |
326 | Which of the following is a super class of all exception type classes? | Throwable | |
327 | Which of the following operators is used to generate instance of an exception which can be thrown using throw? | new | |
328 | Which of the following keyword is used by calling function to handle exception thrown by called function? | throws | |
329 | Which of the following handles the exception when a catch is not used? | default handler | |
330 | Which part of code gets executed whether exception is caught or not? | finally | |
331 | Which of the following should be true of the object thrown by a thrown statement? | Should be assignable to Throwable type | |
332 | Which of these is a super class of all exceptional type classes? | Throwable | |
333 | Which of these class is related to all the exceptions that can be caught by using catch? | Exception | |
334 | Which of these class is related to all the exceptions that cannot be caught? | Error | |
335 | Which of these handles the exception when no catch is used? | Default handler | |
336 | What exception thrown by parseInt() method? | NumberFormatException | |
337 | Which of these keywords is used to generate an exception explicitly? | throw | |
338 | Which of these class is related to all the exceptions that are explicitly thrown? | Throwable | |
339 | Which of these operator is used to generate an instance of an exception than can be thrown by using throw? | new | |
340 | Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function? | throws | |
341 | Which of these clause will be executed even if no exceptions are found? | finally | |
342 | A single try block must be followed by which of these? | finally & catch | |
343 | Which of these exceptions handles the divide by zero error? | Arithmetic Exception | |
344 | Which of these exceptions will occur if we try to access the index of an array beyond its length? | ArrayIndexOutOfBoundsException | |
345 | Which of these classes is used to define exceptions? | Exception | |
346 | Which of these methods return description of an exception? | getMessage() | |
347 | What is the use of try & catch? | All of the mentioned | |
348 | Which of these keywords are used for generating an exception manually? | throw | |
349 | Which of these statements is incorrect? | try need not to be followed by anything |