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

Which are the different segments of memory?

0 Answers  


Should synchronization primitives be used on bean methods?

0 Answers  


What is the difference between static and non-static with examples?

0 Answers   HCL,


How to deploy Jar, War files in J2EE?

0 Answers   HCL,


What are the services in RMI ?

0 Answers  






What is synchronization?

6 Answers   Verizon,


What’s jboss jbpm?

0 Answers  


diff mvc1 and mvc2 wahts is mean by servlet chaining?

1 Answers   SolutionNET,


What is thread deadlock? How to resolve thread deadlock?

3 Answers  


1) which method of the RequestDispatcher cannot be called once the output is sent to the client? a. forward b. include c. both a&b 2) which interface should an object implement to get notified of changes to the list of active sessions in a web application? a. HttpSessionListener b. HttpSessionActivationListener c. HttpSessionAttributeLIstener 3) A user can select multiple locations from a list box on an HTML form, which of the following methods can be used to retrieve all the selected location? a. getParameter() b. getParameterValues() c. getParamValues() 4) which of the following methods should be used to send character text to the client? a. ServletResponse.getWriter() b. ServletResponse.getOutputStream() c. ServletResponse.getOut() 5) which implicit object is always available in a JSP page? a. exception b. session c. out 6) which inclusion mechanism doesn't include the source of the page, rather the output of the page. a. include directive b. jsp:include action c. Bothe a& b 7) which attribute of the page controls whether a page participates in session or not? a. session-allowed b. session c. isSession

1 Answers  


difference between Abstract and Interface?

2 Answers   HCL, Infotech,


suppose i open my yahoo mail.then copy the url. then sign out & close browser.then open browser paste that url on the browser.will i get my mail opened or not? i know it ill not.but how it work.how i create like this type of secure site?

7 Answers  


Categories