Core Java - Interview Questions and Answers for 'Boxing' | 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

   



Core Java - Interview Questions and Answers for 'Boxing' - 4 question(s) found - Order By Newest

 Q1. What are concepts introduced with Java 5 ?Core Java
Ans. Generics , Enums , Autoboxing , Annotations and Static Import.

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

   Like         Discuss         Correct / Improve     java   java5   generics   enum   autoboxing   annotations   static import        rare

Try 1 Question(s) Test


 Q2. Will this code give error if i try to add two heterogeneous elements in the arraylist. ? and Why ?

List list1 = new ArrayList<>();
list1.add(5);
list1.add("5");
Ans. If we don't declare the list to be of specific type, it treats it as list of objects.

int 1 is auto boxed to Integer and "1" is String and hence both are objects.

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

   Like         Discuss         Correct / Improve     java   collections   arraylist   list   autoboxing   wrapper classes      expert        rare


 Q3. Explain Autoboxing ?Core Java
Ans. Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes

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

   Like         Discuss         Correct / Improve     java   java5   autoboxing   wrapper classes     Asked in 2 Companies      basic        frequent


 Q4. What is Boxing conversion ?Core Java
Ans. Boxing conversion converts expressions of primitive type to corresponding expressions of reference type.

For example

boolean to Boolean
long to Long
double to Double

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

   Like         Discuss         Correct / Improve     data type  boxing  wrapper classes



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: