k_diff challenge in Java
Some things which just jump into my eyes (even if not asked, I'll tell you anyway):


Whitespaces: Use whitespaces were appropriate, f.e. for(int i=0;i&lt;nums;i++) is harder to rad then for(int i = 0; i &lt; nums; i++).
Meaningful names: Name your variables after what they are, not what type they are. This especially includes simple for loops. It might be taught or standard to use i, but I consider it bad practice because you never know what exactly i is at first glance. Give your variables meaningful names, please, they deserve love too! Same goes for your classes.
Split up where appropriate: if you've got only one function (main) you're most likely doing something wrong. Split it into Input, Processing and Output.