Don't we need java or c programming for hacking?
Hacking what? Hacking is a word too general. The most exploits are written in C, C++, Python and Ruby... or Assembly, it depends on what you need to do. If you are a beginner, start with Python, then learn Metasploit framework and Linux OS.