I have three hashmaps, 2 of them have multiple values (arrayLists).   Map&lt;String, String&gt; advise = new HashMap&lt;String, String&gt;();     Map&lt;String, ArrayList&lt;String&gt;&gt; teach = new HashMap&lt;String,ArrayList&lt;String&gt;&gt;();     Map&lt;String, ArrayList&lt;String&gt;&gt; takesCo = new HashMap&lt;String,ArrayList&lt;String&gt;&gt;();     //ArrayList&lt;String&gt; courses = new ArrayList&lt;String&gt;;    I want to iterate over them based on the key of the first hashmap (advise) The array lists contain course names and I want to print when there is a match.  for (String x : advise.keySet()) {      String y = advise.get(x);     ArrayList&lt;String&gt; z1values = teach.get(y) ;     ArrayList&lt;String&gt; z2values = takesCo.get(x) ;     if (!z1values.isEmpty() &amp;&amp; !z2values.isEmpty()){     for (String z1:z1values){         for (String z2:z2values){             if (z1.equals(z2)){                 result=x+","+y+","+z1;                 system.out.println(result);                 }             }         }     } }   I get nullPointerException in line with the if statement
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Find the value of $\sum_{k=1}^{n}k\binom{n}{k}$ ?    I know that $\sum_{k=0}^{n}\binom{n}{k}= 2^{n}$ and so, $\sum_{k=1}^{n}\binom{n}{k}= 2^{n}-1$ but how to deal with $k$ ? Option clash for package xcolor Can the software be downloaded on an Android device?  If yes, then what is the process? Are there any areas that should be avoided and are there any steps I should take to protect myself from radiation? How to select a good non-stick pan, price point wise? Is it possible to open directories as administrator? I want to have a root privileges on some directories. How can I do this? Sed - unknown option to `s' I am non-EU citizen working in Germany. Can I travel to UK without a visa? I am from Non-EU country (from Nepal to be precise) and recently moved to Germany for work. I am applying for BlueCard. I would like to travel to UK later this year, can I go there without visa as I am resident in another EU country?  I can't find this information online. Any links/references will be much appreciated. Orthonormal basis with specific norm I need to show that $v_1,...,v_n$ is basis for $V$ whenever $e_1,...,e_n$ is an orthonormal basis for V and $v_1,...,v_n$ are vectors in $V$ such that $$\left\Vert e_i-v_i\right\Vert &lt; \frac{1}{\sqrt{n}}.$$ I know already that I only need to prove that they are lineary independent. Also I tried to prove it by contradiction, but I got stuck fairly fast. Any help, or hint how to prove it (with ot without contradiction) will be appriciated. How to download Ubuntu over an unreliable connection Does the Google spider render JavaScript? Is it possible to perform a complete reinstall on an Android smartphone? I occasionally perform such a reinstall on my Windows PC. I repartition my hard drive, format the partitions, and then install Windows on a blank partition. Can this be done on an Android smartphone? (I have an unlocked Sony Xperia S.) list files and store it in variables I'm new with shell programming. My goal is to give the user a selection which file should be run. I catch all available scripts in one var with:  var=$(find script*)   so far so good, this is the output:      echo $var     script1 script2 script3 scr...   now I want to store each file in a singel variable to run it in later selection  select SEL in script1 script2 script3 .......... case $SEL in         $Script1) echo ($Script1 will start) &amp;&amp; ./$script1 ;;         $Script2) echo ($Script2 will start) &amp;&amp; ./$script2 ;;         $Script3) echo ($Script3 will start) &amp;&amp; ./$script3 ;;         $Sc..) echo ($Scr.... will start) &amp;&amp; ./$scrip.... ;;         $Sc...) echo ($Sc...... will start) &amp;&amp; ./$scrip..... ;;         *) echo "choose on of the availabel files";;     esac done   I don't have a clue how should I should separate all files if I don't know how many and the exactly length of each file.  I tried to split with echo ${var[1]} and echo $var[1] but this dosn't work. I recive either a empty output or the whole string. Why has my database connection failed? Will the Windows 10 Free Upgrade stay in the Professional channel? Why is the change in Hamiltonian for an active infinitesimal canonical transformation defined the way it is? I'm trying to understand infinitesimal canonical transformations and conservation theorems (section 9.6 Goldstein ed3). My specific problem is with understanding eq 9.104,         $\partial H = H(B) - K(A^{'}) $, where $\partial H$ represents the change in the hamiltonian under an infinitesimal canonical transformation (from the active view point ofc). The issue only arises for generating functions that explicitly depend on time.  Here's what I've thought of so far. I understand what $K$ is from the passive viewpoint (or so I think), its the hamiltonian that would furnish Hamilton's equations for the transformed variables $Q=q+ \delta q$ and $P = p + \delta p$. In the specific case of the generating function being a time dependent hamiltonian, $K = H + \delta t \frac{\partial H}{\partial t} = H + \delta t\dot H$, which makes sense because once you transform the variables to what they'll be in time $\delta t$, you'll also need to add on a term that comes from the Hamiltonian being at a later time $t+ \delta t$.   In the book, this is explained as a transformation depending on time changes the hamiltonian, so $H(A) \rightarrow K(A^{'}) $. Which I sorta get. But why not for $H(B)$? And what about the case when the Hamiltonian is time dependent and it is the generating function? Is $H(B)$ at a later time then?   Note: $A$ represents the original variables, $B$ is the transformed variables in the active sense, so in the same phase space as $A$, and $A^{'}$ is the same point as A but in the transformed phase space (passive). One way function existence Let $x = (x_1, x_2,...,x_n)\in\{0,1\}^n$ for $n\in\mathbb{N}$. Prove that if one-way functions (OWFs) exist, then there exists a one-way function $f$ such that for every bit $i\in[1,n]$ there exists an algorithm $A_i$ such that: $$\Pr[A_i(f(x)) = x_i] \geq \frac{1}{2} + \frac{1}{2n}$$ I'm having trouble understanding this. Can inductor voltage and capacitor current change abruptly? I understand that inductor current and capacitor voltage cannot change abruptly, but can inductor voltage and capacitor current change abruptly?  I have a feeling the answer is no but I cannot explain why. What is the difference between a HMAC and a hash of data? If an enemy is just below a 10-foot-high ceiling, are they in melee range of a creature on the ground?