Results 1 to 3 of 3
  1. #1
    javaforumfb is offline Member
    Join Date
    Oct 2011
    Posts
    1
    Rep Power
    0

    Default Best way for new Java programmer to learn Java class libraries..?

    I'm an experienced programmer (c++) but just learning Java..

    I want to use the massive amount of functionality built into the Java class libraries in my coding, rather than trying to reinvent the wheel, and see that as one of my biggest learning curves as I try to learn the language.

    I had a rude awakening this afternoon when one of my beginner's programming guides had me do an interest rate calculation, and I simply then wanted to round the result of the calculation to two decimal places..

    I tried looking in the NetBeans help system, but had trouble finding what class library functionality to use, probably because looking for "round a number" returned hundreds of results, most having nothing to do with that task.

    I found this link from Oracle which has an 'Essential Java classes' link, and generally might be useful -http://download.oracle.com/javase/tutorial/

    And this one -http://download.oracle.com/javase/7/docs/api/overview-summary.html

    In the Math library ran into a complex discussion of the 'Bigdecimal class' in the math library, and references to rounding modes there, but I was surprised that such a simple operation was wrapped in so much seeming complexity..

    The problem I had with the description of this class (BigDecimal (Java Platform SE 7 ))
    was that it was full of verbose rambling text but from my beginner's point of view - weak on actual examples on how to use the thing in real life.

    Come on, all I want to do is round a double value from 514.12322 or whatever to 514.12 - do I really need to instantiate a class to do that? and what exactly is the syntax for doing so?

    At any rate, I'm wondering if anyone can point me to what they think is the best way to get some practical familiarity with the libraries..

    Are these Oracle links as good as anything for learning, or is there a better book, or online tutorial out there in your opinion?

    It would be sweet if there was a query engine that was pretty good at actually "understanding" what the programmer wants to do and pointing him/her to the library functionality that addresses that need (and ideally with practical examples of usage shown in code, not just egghead API talk), but not sure that exists..??

    I went to Amazon.com and was surprised when entering "Java class library" that I saw mostly books written in 1998 or 1999!

    As for IDE's, I am using the latest NetBeans 7.0.1, seemed friendlier (overall, not impressed with the help search engine so far though) than Eclipse to me, though I'd be interested in opinions on the best IDE for learning also..

    Thank you..

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,302
    Blog Entries
    7
    Rep Power
    20

    Default Re: Best way for new Java programmer to learn Java class libraries..?

    First things first: you can't exactly repesent the number 1/10 in binary floating point format (IEEE754) It is explained in great detail here; a corollary is that you can't round a number to two decimal places, but you don't need that; maybe you want to visualize a number with two decimal places; the DecimalFormat class can do that for you; it is used by the printf( ... ) method in the PrintStream (and PrintWriter) class.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    4

    Default Re: Best way for new Java programmer to learn Java class libraries..?

    Find a library that looks interesting, and then read each function. Then make a project called like 'Reference' and make a new class which uses an example of every method in the class you chose.

Similar Threads

  1. Replies: 4
    Last Post: 07-17-2010, 10:50 AM
  2. Installing Java libraries
    By DC200 in forum New To Java
    Replies: 13
    Last Post: 03-21-2010, 05:58 AM
  3. Java Media Libraries
    By SilentCodingOne in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2009, 05:21 AM
  4. Location of java class libraries on Sun
    By phudgens in forum New To Java
    Replies: 3
    Last Post: 02-05-2009, 04:45 AM
  5. C++ programmer wants to learn java very fast...
    By joe saunders in forum New To Java
    Replies: 5
    Last Post: 01-05-2008, 12:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •