|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
what's the most efficient?
import java.awt.event.*; import javax.swing.*; import java.sql.*; OR import javax.swing.table.TableModel; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; import javax.swing.event.TableModelListener; whats the desired method to improve performance? or doesnt it matter? .... compiler just imports the libraries used? *TableModel 's a bitch *
__________________
With Your Hand On A Hot Stove, Fifteen Seconds Can Seem Like Fifteen Minutes. Fifteen Minutes Can Seem Fifteen Seconds When You Are With A Beautiful Woman. That's The Theory Of Relativity -- Albert Einstein \\ |
|
#2
|
|||
|
|||
|
There is no difference in performance between using single-type-import (java.package.ClassName) vs import-on-demand (java.package.*). The compiler just uses the declarations to find the fully qualified name when resolving classes when compiling.
However, that being said, it is generally preferred to use a list of single-type-imports for readability. It makes it very clear when maintaining code where a particular class is located. If you use an IDE such as Eclipse (www.eclipse.org) it will put the single-type-import names in for you. P.S., Just wait until you try using a JTree.... ![]() |
|
#3
|
||||
|
||||
|
for the most part i usually advice to go with the single style import, but when dealing with javax.swing i almost ALWAY go with javax.swing.*; simply because there are so many different classes that I use i feel its simpiler.
i think the compiler, will compile it the same regardless, as long as it finds the classes used it will compile the same, since importing is classes that are already compiled, just access to them. |
|
#4
|
||||
|
||||
|
I use single import now ... is indeed much more readable....
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > effeciency |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|