In HashTable I am storing null value..then what is the
error it will show

Answers were Sorted based on User's Feedback



In HashTable I am storing null value..then what is the error it will show..

Answer / mvteja

Hashtable does not contain null value. if v try to store
null value, v will get the following error.




F:\Test>javac -d . Test.java

F:\Test>java a.b.c.Test
Exception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at a.b.c.Test.<init>(Test.java:18)
at a.b.c.Test.main(Test.java:27)

F:\Test>

Is This Answer Correct ?    16 Yes 0 No

In HashTable I am storing null value..then what is the error it will show..

Answer / karthik

Normally hastable doen't allow null value, it will through
run time exception like NullPointerException

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

What is permgen or permanent generation?

0 Answers  


whats is mean by tiles in struts

0 Answers   SolutionNET,


Explain the purposes of methods wait(), notify(), notifyAll ()?

2 Answers  


diff between jsp include directive and jsp action include?

4 Answers   SolutionNET,


What is re-entrant. Is session beans reentrant. Is entity beans reentrant?

0 Answers  






Why are some of the class and element names counter-intuitive?

0 Answers  


What is the purpose of the wait(), notify(), and notifyall() methods?

0 Answers  


how the mapping can be done from jsp to actionservlet?

2 Answers   SolutionNET,


What are the ways to define classes that can be run as threads?

1 Answers   KPIT,


whats is stored procedure,joins

1 Answers   Photon,


Does Java pass arguments by value or reference?

5 Answers   HeadStrong,


What is RMI and what are the services in RMI?

0 Answers  


Categories