Hey, I know that emacs supports code completion. But to be honest I have never been a good FAQ reader, at least for something that I'm completely new to. So I wonder what I need to download and how to make so emacs can do some smart code completion for me in C++, and Java. Or is there any package which does code completion for many of major languages?
The basic way that will work across any sort of buffer in emacs is dynamic abbreviation used by hitting
That will expand text to duplicate other strings already existing in your current buffer or in other buffers currently open.
For more extensive code completion that is language specific for C++ or Java (or others), you'll want to look at a code templating or snippet package. There are some discussed in this related question on StackOverflow. One that is commonly mentioned in these discussions is yasnippet -- there's a screencast demo in this post on an emacs blog.
@Doug's answer is a little out of date and his focus is on code expansion by using pre-defined snippets.
I think the OP's question is about intellisense (auto complete method name of a class, for example).
In summary, the big four (hippie-expand, auto-complete, semantic, company) are the ones you may be interested. Many others are just too trivial to mention and their features may be already covered by the big four. For example, auto-complete could use yasnippet as input source (auto-complete provide the UI, but the actual candidates are produced by yasnippet backend).
As for me, I use hippie-expand and company-mode.
UPDATE: Now (Year 2014) company-mode and auto-complete are most popular and actively maintained. I think you can pick one from either of them.
hippie-expand could be also turned on because its default key binding does not conflict with the others. But I don't think you need turn on its ctags support.
Short answer: I know none for emacs that is useful for java. Dynamic expand does not care for the libraries in your class path, it does not know anything about the code you're typing it can only expand to text that already exists in one of the buffers. JDE and emacs-eclim try to provide this functionality but personally I was not impressed.