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
If a method is declared as protected, where may the method be accessed in java programming?
Say you want to store the information about a number of pets in an array. Typical information that you could store for each pet (where relevant) would be • Breed of animal • Animal's name • Its birth date • Its sex • Whether it has been sterilised or not • When it is due for its next inoculation • When it last had its wings clipped For each type of pet (eg. dog, cat or bird) you would typically define a class to hold the relevant data. Note: You do not need to implement these classes. Just answer the following questions. 3.1.1 What would be the advantage of creating a superclass (eg. Pet) and declaring an array of Pet objects over simply using an array of Objects, storing each of the instances of the different pet classes (eg. Dog, Cat or Bird) in it? 3.1.2 Would you define Pet as a class or as an interface? Why? (2) (2)
What does void * mean?
Which access specifier can be used with class ?
Tell us something about set interface.
In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?
What is gui programming?
What is meant by string is immutable?
List the different types of classloaders in java.
Which methods are used during serialization and deserialization process?
What is a substring of a string?
What is meant by oops concept in java?
Can we create an object of private class?
What does n mean?
What is a package in java? List down various advantages of packages.