Can we place the any object to key attribute of
HashMap<key,value>?
Answer Posted / patil abhijeet
Hi Ramarao,
Its not necessary to override hashCode() since hashcode is
default generated for every object. Please try my example n
check it by urself
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain when we should make an instance variable private.
What is the function of http?
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 is indexof?
Explain java coding standards for classes or java coding conventions for classes?
Why is stringbuffer not immutable?
Explain covariant method overriding in java.
Can a class have a static inner class?
What is sortedmap in java?
How can you share data between two thread in Java?
Write a function to find out longest palindrome in a given string?
what is the difference between yielding and sleeping? : Java thread
What is string data?
Which class contains a method: cloneable or object?
What is polymorphism java example?