Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers for 'Mindteck' - 3 question(s) found - Order By Newest | ||||
Very frequently asked. Favorite question in Walk in Drive of many Indian service companies. Frequently asked in HCL Technologies, TCS and Accenture. | ||||
| ||||
Ans. final - constant variable, objects cannot be de-referenced, restricting method overriding, restricting class sub classing. finally - handles exception. The finally block is optional and provides a mechanism to clean up regardless of what happens within the try block. Use the finally block to close files or to release other system resources like database connections, statements etc. finalize() - method helps in garbage collection. A method that is invoked before an object is discarded by the garbage collector, allowing it to clean up its state. | ||||
Sample Code for final Sample Code for finally Sample Code for finalize | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   oops   final   finally   finalize   final vs finally vs finalize Asked in 61 Companies basic   frequent | ||||
Try 4 Question(s) Test | ||||
Related Questions | ||||
Difference between final and effectively final ? Why is effectively final even required ? | ||||
Which of the following combination of keywords is illegal in Java ? a. static and transient b. transient and final c. static and synchronized d. abstract and final | ||||
What is a final method ? | ||||
Which keyword is used to provide explicit access of a code block to single thread ? a. Transient b. Final c. Explicit d. Synchronized | ||||
Enums cannot be declared .. | ||||
What is a Final Variable ? | ||||
Should we override finalize method ? | ||||
Will the static block be executed in the following code ? Why ? | ||||
Can we override compareTo method for Enumerations ? | ||||
Frequently asked in Indian Service Companies. Tech Mahindra ( Based on 3 inputs ) and Infosys ( 3 inputs ) | ||||
| ||||
Ans. List - Members are stored in sequence in memory and can be accessed through index. Set - There is no relevance of sequence and index. Sets doesn't contain duplicates whereas multiset can have duplicates. Map - Contains Key , Value pairs. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  java   collections   list   set   map   list vs set vs map Asked in 8 Companies basic   frequent | ||||
Try 1 Question(s) Test | ||||
Related Questions | ||||
What is the difference between ArrayList and LinkedList ? | ||||
If you are given a choice to use either ArrayList and LinkedList, Which one would you use and Why ? | ||||
Difference between HashMap and Hashtable? | ||||
Difference between TreeMap and HashMap ? | ||||
Can you provide some implementation of a Dictionary having large number of words ? | ||||
Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ? | ||||
What is a ConcurrentHashMap ? | ||||
Collections.sort can only be performed on .. a. Set b. List c. Map d. Any Collection implementation | ||||
Why HashTable has been deprecated ? | ||||
Difference beween HashSet and TreeSet ? | ||||
Frequently asked. | ||||
| ||||
Ans. A finally block of code always executes, whether or not an exception has occurred.The only time finally won't be called is if you call System.exit() or if the JVM crashes first. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  finally  exception handling  exceptions Asked in 4 Companies basic   frequent | ||||
Related Questions | ||||
What is the difference between final, finally and finalize() ? | ||||
How can we make sure that a code segment gets executed even in case of uncatched exceptions ? | ||||
Is it necessary that each try block to be followed by catch block ? | ||||
Can we have try and catch blocks within finally ? | ||||
When is the situation when finally section won't execute ? | ||||
Can finally block be used without catch ? | ||||
How finally used under Exception Handling? | ||||
Will finally be called always if all code has been kept in try block ? | ||||
Can finally block throw an exception ? | ||||