Can you add null to a list java?



Can you add null to a list java?..

Answer / Arpit Gautam

[n "Yes, you can add 'null' to a List in Java. However, if you are using an ArrayList and want to avoid adding 'null', you should use the add() method with a parameter to specify the element."]

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

class{ ... ... interface myinterface{ ... ... } abstract class{ .. .. } ... .. .. } is this possible to write "Interface and/ or Abstract class inside a class ? if possible whcich one is possible is only interface? is only abstract?

2 Answers   Logica CMG,


What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?

1 Answers  


Can singleton class be cloned?

1 Answers  


What are default methods ?

1 Answers  


what is synchronization

3 Answers  


What is the difference between the ">>" and " >>>" operators in java?

1 Answers  


How do u provide security in java

3 Answers  


What is the collection interface?

1 Answers  


what is the difference between java and j2ee... is that can i work j2ee on net beans IDE 6.0

2 Answers  


What is a stack class in java ?

1 Answers   Akamai Technologies,


What are the two types of exceptions in java? Which are the differences between them?

1 Answers  


What is the Difference between Final Class && Abstract Class?

1 Answers   HCL,


Categories