This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Top 20 frequently used java packages

 
krishna balaji
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i saw API documentation from java.sun.com
there are about 200 packages
can you mention top 20 packages which are frequently used and most important
 
Campbell Ritchie
Sheriff
Pie
Posts: 49382
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Difficult to say which is most important . . .

Some of the more frequently used:
  • java.lang Used all the time. String may be the most frequently used class of all
  • javax.swing
  • java.awt.event
  • java.util
  • java.io
  • In beginners' code, 99% of the API classes used will probably come from those packages.

    Avoid packages whose names start with com.sun or similar; those classes might be changed in the future.
    Don't go through packages reading all the classes, but look for the classes you think you might need and look at their API documentation.
     
    Jesper de Jong
    Java Cowboy
    Saloon Keeper
    Posts: 15356
    39
    Android IntelliJ IDE Java Scala Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    It's difficult to answer that question, because what packages you need depends on what kind of software you are writing. For example, if you are writing a desktop application or an applet, then you most likely use the Swing and AWT packages (javax.swing and java.awt), but if you're writing server-side software that doesn't have a GUI then you don't need those.

    Ofcourse, the classes in java.lang and java.util are the most used packages from the standard Java API.
     
    Joe Ess
    Bartender
    Posts: 9298
    10
    Linux Mac OS X Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Campbell Ritchie:
    String may be the most frequently used class of all


    This is true of every application I've run through a profiler (mostly web apps). I seem to remember that second place went to HashTable, presumably used by the JVM or J2EE for mapping purposes.
     
    marc weber
    Sheriff
    Posts: 11343
    Java Mac Safari
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Depending on what you're doing, I might add java.math and java.text to the list. But as already mentioned, a beginner is not going to stray much outside of java.lang and java.util, and the list of other packages you're likely to use is a lot smaller than you think. So don't let the API intimidate you.
     
    Jim Yingst
    Wanderer
    Sheriff
    Posts: 18671
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I think these are probably my top, well, 23:

    java.lang
    java.util
    java.io
    java.util.regex
    java.text
    java.sql
    java.net
    java.util.concurrent
    java.util.concurrent.locks
    java.util.concurrent.atomic
    javax.servlet
    javax.servlet.http
    java.lang.reflect
    java.nio
    java.nio.channels
    java.nio.charset
    javax.swing
    java.awt
    java.awt.event
    org.xml.sax
    org.w3c.dom
    javax.xml.parsers
    javax.naming

    I think the first two will be true for eveyone, and after that it really depends on what sort of jobs you get hired to do. As a beginner, I'd just focus on the first two.
    [ December 21, 2007: Message edited by: Jim Yingst ]
     
    krishna balaji
    Ranch Hand
    Posts: 31
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you
    it was very useful
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic