Reputation: 3886
Okay, I recently started learning Java/Android so I look up a lot of tutorials and do a lot of copying/pasting, but most of the times the tutorial doesn't have the imports imported, so I have to go down the line clicking all the errors then Import this, import that, import something else! So... my question: Is there a way to import all of them at once?
Upvotes: 45
Views: 50295
Reputation: 7457
On Windows you can use: Ctrl+shift+o which is a shortcut to Organize imports
On Mac it is Command+Shift+O (Thanks orip)
Upvotes: 102
Reputation: 4171
There are classes that have same name but do different work. See how many classes Date
. At first time this looks not comfortably, but you will get used very fast.
You can organize your imports automatickly, in NetBeans I use Ctrl+shift+i hotkey. There must be analog in other IDE`s.
Also importing a whole package (like this: java.util.*
) is a bad practice
Upvotes: 2
Reputation: 135
You have some shortcuts on eclipse, look this page.
http://www.allapplabs.com/eclipse/eclipse_shortcuts.htm
I hope it help you, there you have the shortcuts named before for they and others more.
Sorry for mi English I hope it help you.
Upvotes: 2