What is meant by HTPAIR ?
Hashmap tables htpair
What is meant by null ponter exception?
HTPair is basically short for HashTablePair. In your Hash Table, you will be storing key-value pairs, so we have defined a class called HTPair like this :
class HTPair{
int key;
int value;
}
So when you create a linkedlist of type HTPair, each node of the linkedlist will contain values of type HTPair i.e each node will have a key and value associated with it.
NullPointerException is a RuntimeException. In Java, a special null value can be assigned to an object reference. NullPointerException is thrown when your code attempts to use an object reference that has the null value.
For example: say you have a Node n = null;
Now if you try to access n.value in your code, it will give a NullPointerException because the node is null and does not have any place in memory that can be accessed.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.