Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old December 5th, 2002, 01:49 PM
H@voc_!nc.'s Avatar
H@voc_!nc. H@voc_!nc. is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Belgium
Posts: 39 H@voc_!nc. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 48 sec
Reputation Power: 8
Send a message via ICQ to H@voc_!nc.
Question effeciency

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 \\

Reply With Quote
  #2  
Old December 6th, 2002, 08:59 AM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
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....

Reply With Quote
  #3  
Old December 6th, 2002, 03:54 PM
Shocka's Avatar
Shocka Shocka is offline
dont click here
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 409 Shocka User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 35 m
Reputation Power: 7
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.

Reply With Quote
  #4  
Old December 7th, 2002, 08:24 AM
H@voc_!nc.'s Avatar
H@voc_!nc. H@voc_!nc. is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Belgium
Posts: 39 H@voc_!nc. User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 48 sec
Reputation Power: 8
Send a message via ICQ to H@voc_!nc.
I use single import now ... is indeed much more readable....

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > effeciency


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway