GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  Java
Go To First  |  Previous Question  |  Next Question 
 Java  |  Question 905 of 923    Print  
Can HashMap store null values?If yes, how many?
Can HashMap store null values?If yes, how many?

What is singleton class? Give one example.

Please describe the difference between 'int' and 'Integer',
what is the purpose of 'Integer', where should we use 'Integer' vs 'int'?




  
Total Answers and Comments: 2 Last Update: March 22, 2008     Asked by: Namataraginu 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 01, 2008 02:41:34   #1  
kim2kim Member Since: February 2008   Contribution: 2    

RE: Can HashMap store null values?If yes, how many?
Yes.  However many the map can hold.
 
Is this answer useful? Yes | No
March 22, 2008 11:41:15   #2  
fcasttro Member Since: March 2007   Contribution: 16    

RE: Can HashMap store null values?If yes, how many?
Map Won't allow duplicates, So It will accept one null value.

HashMap map = new HashMap();

map.put(

null, null);map.put(null, null);

map.put(null, null);

After adding 3 null key / value pairs. It will show only one null value.

int => Primitive
Integer =>Object  (Wrapper Classes)

Wrapper classes are used to access the primitives(int) as Objects.


 
Is this answer useful? Yes | No

 Related Questions

The null value is not a keyword. 
Latest Answer : ...true, false, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.[1][1]:http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html ...

The readLine() method returns null when it has reached the end of a file. 
Latest Answer : readLine() method of BufferReader class returns String and when it reaches the end of file file it returns null. ...

The default value of an String type is null. 
Latest Answer : We use overriding when method avaliable in super class doesnot satisfyour requirement.That is To extend the alreadyavailable feature wew use overloading.If we require the new functionality other than, what we already have we go for Overriding. ...

The Dictionary class provides the capability to store key-value pairs. 
Latest Answer : run this file, i think result will itself explain you the use of LOG4J. otherwise mail me ritesh.patni@gmail.com :- package com.banking.log4j; import org.apache.log4j.*;  import com.lnt.banking.constant.ConstantIf; public class ...

During compilation, the values of each case of a switch statement must evaluate to avalue that can be promoted to an int value. 

A static variable is associated with the class as a whole rather than with specific instancesof a class. Non-static variables take on unique values with each object instance. 
Latest Answer : Static variables belongs to class only they have no relation to object. They allocate memory when class is loaded at run time. That's why we can call them by the name of class variables. Non-static variables belongs to object. They allocate ...

The abs() method is used to calculate absolute values. 

There are two types of casting, casting between primitive numeric types and castingbetween object references. Casting between numeric types is used to convert largervalues, such as double values, to smaller 
Latest Answer : By definition, Casting is the way of converting one data type into another. ...

How is it possible for two String objects with identical values not to be equalunder the == operator
The == operator compares two objects to determine if they are the same object inmemory. It is possible for two String objects to have the same value, but locatedindifferent areas of memory. 

The left operand is an object reference or null value and the right operand is a class,interface, or array type. 


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

What is Operational Data Store (ODS)

An Operational Data Store (ODS) is an integrated database of operational data. Its sources include legacy systems and it contains current or near term data. An ODS may contain 30 to 60 days of information, while a data warehouse typically contains years of data. An operational data store is basica
 

Assign values during declaration

How to assign values during declaration of variables Declaring variables tells the compiler the data type the variable is assigned and no storage area is allocated during this stage. It is possible to assign values during declaration itself. For example, consider the following program: main() {
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

Using UML with Java

Using UML with Java While Java is not a new language its application for the development of embedded systems is quite new Developers are beginning to take a second look at modeling languages such as UML and many feel it can be a powerful tool in their development arsenal mosgoogle center Introductio
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

Passing values to JavaScript Function

Passing values to JavaScript Function In this JavaScript Tutorial you will learn about how to pass values to and also how to return values from a JavaScript function mosgoogle center Passing Values to function Values can be passed to a function as parameters The general syntax for passing values to
 

Java Technology Trends

Technology Trends Involving Java Java is an object oriented programming language OOP for Web browsers It is organized around data rather than actions and supports polymorphism which allows the same code to be written generically so it can function with different datatypes inheritance which allows on
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape