They had given one progam
final HashMap hm=new HashMap();
public void show()
{
hm.put("name",value);
}
in this prg here the final hashtable value can be changed in
put method,its the prg run?

Answer Posted / kr

hash map values can be modified but the hashmap object
cannot be modified
hm.put("name",value); //allowed

hm = new HashMap() // throw error since the object is fianl

Is This Answer Correct ?    19 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

1493


Can you explain the cs option of java interpreter?

509


Which sort is best in java?

536


Can a class be a super class and a sub-class at the same time? Give example.

803


Where are the local variables stored?

521






Why method overriding is used?

542


Does substring create a new object?

530


What is the benefit of using enum to declare a constant?

661


What is a function easy definition?

529


Explain aggregation in java?

549


How can you set the applet size?

584


Explain garbage collection in java?

549


What is collections framework?

582


What is a modifier?

878


How does hashmap work in java ?

545