Interview Questions and Answers for 'Optum' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

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.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Optum' - 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.
  Q1. What is the difference between final, finally and finalize() ?Core Java
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 ?


Very Frequently asked. Have been asked in HCL Technologies very frequently ( based on 3 feedback ). Among first few questions in many interviews.
  Q2. Differences between abstract class and interface ?Core Java
Ans. Abstract classes can have both abstract methods ( method declarations ) as well as concrete methods ( inherited to the derived classes ) whereas Interfaces can only have abstract methods ( method declarations ).

A class can extend single abstract class whereas it can implement multiple interfaces.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   classes   abstract class   interfaces   abstract class vs interface   abstract classes vs interfaces     Asked in 82 Companies      basic        frequent


Related Questions

 What are the different uses of Interfaces in Java ?
 Why can't we have diamond problem with interfaces ?
  Why do we need Thread class even in case we execute thread using runnable interface ?
  What is the difference between List, Set and Map ?

or

What are the different Java Collections Interfaces ?
  What are Marker Interfaces ? Name few Java marker interfaces ?
  Can we declare interface methods as private ?
  What is comparator interface used for ?
  What is the use of runnable interface if we can always create a new thread using Thread class ?
  Which of the following doesn't extend Collection interface ?


 Q3. Explain Generics in Java ?Core Java
Ans. Generics are a facility of generic programming that were added to the Java programming language in 2004 within J2SE5.0. They allow "a type or method to operate on objects of various types while providing compile-time type safety.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     generics     Asked in 7 Companies


Related Questions

  What are concepts introduced with Java 5 ?
 Is this a valid initialization ? Explain.

Collection<Collection> collection = new LinkedList<LinkedList>();
  Which of the following syntax is correct ?import static java.lang.System.*;or static import java.lang.System.*;
  Is it legal to initialize List like this ?
  Which of the following syntax are correct ?a. LinkedList<Integer> l=new LinkedList<int>();b. List<Integer> l=new LinkedList<int>();c. LinkedList<Integer> l=new LinkedList<Integer>();d. List<Integer> l = new LinkedList<Integer>();
  Which of the following was not introduced with Java 5 ?
 What are Type Erasures in Java ?
 In case of generic class declared like following , What can T hold

class MyClass<T>{
T element;
}
 Can we use generics with arrays in Java ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: