Author Topic: Good Java books?  (Read 9347 times)

0 Members and 1 Guest are viewing this topic.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Good Java books?
« Reply #20 on: December 22, 2009 »
I am really enjoying this book, it's gentle and at the same time really informative, I would reccomend it to any would be OOP programmers too.

I've always been frightened off OOP by the complicated development environments, this book takes the sting away from it by using a simple IDE so you can worry about using netbeans or eclipse later once you've grasped the language :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline JL235

  • C= 64
  • **
  • Posts: 71
  • Karma: 9
    • View Profile
    • Play My Code
Re: Good Java books?
« Reply #21 on: December 23, 2009 »
There is another learning IDE that the same guys have built called Greenfoot. It's a nice environment and now comes with it's own book too (some of my source code is in that book).

Like the BlueJ environment, the Greenfoot one does a lot of work to make programming easier and simpler. Only this time it provides a visual world you can add objects too and then interact with. As a result it's more games related then BlueJ, but if you have Objects First then I don't think you'll find the Greenfoot book as useful.
Play My Code - build games in your browser!

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Good Java books?
« Reply #22 on: December 23, 2009 »
I don't really want it for games to be honest mate.

After I have gone through this book I'll have to learn Eclipse because that's what they are using in work.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17407
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Good Java books?
« Reply #23 on: December 24, 2009 »
Yay! My first class...

I know it's simple..

Code: [Select]
/**
 * Class to simulate central heating system control.
 *
 * @author Nick SImpson
 * @version 24/12/09
 */
public class heater
{
    //-------------------------------------------------------------------
    // Fields.
    //-------------------------------------------------------------------

    private int temperature;
    private int maxTemp;
    private int minTemp;
    private int increment;
   
    //-------------------------------------------------------------------
    // Constructors.   
    //-------------------------------------------------------------------
       
    /**
     * Constructor for objects of class heater
     */
   
    public heater(int max, int min, int incr)
    {
        temperature = 15;
        maxTemp     = max;
        minTemp     = min;
        increment   = incr;       
        // Prevent negative temperature increments.
        if (increment<0 ) {           
            increment = -increment;
        }
    }   
   
    //-------------------------------------------------------------------   
    // Methods.
    //-------------------------------------------------------------------
   
    /**
     * Increase temperature by increment degrees mutator.
     */
   
    public void warmer()
    {
        temperature += increment;
        // Limit temperature to maximum.
        if (temperature > maxTemp){
            temperature=maxTemp;
        }
    }   
   
    /**
     * Decrease temperature by increment degrees mutator.
     */
   
    public void cooler()
    {
        temperature -= increment;
        //Limit temperature to minimum.
        if (temperature<minTemp) {
            temperature=minTemp;
        }
    }   
   
    /**
     * Return the temperature accessor.
     */
   
    public int returnTemp()
    {
        return temperature;
    }       
}
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Good Java books?
« Reply #24 on: December 24, 2009 »
welldone nick and keep going :0)

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Good Java books?
« Reply #25 on: December 26, 2009 »
@Shocky:
Congratz for your first class. Nice to see that it is a heater (fits to
the current season). Most "first classes" are something like dog class
(private field name, public method bark()).

One minor cosmetic hint though, I would recommend to start
a class name with a capitalized letter
.

Well, but thats minor stuff ... Keep it going!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline JL235

  • C= 64
  • **
  • Posts: 71
  • Karma: 9
    • View Profile
    • Play My Code
Re: Good Java books?
« Reply #26 on: December 27, 2009 »
One minor cosmetic hint though, I would recommend to start
a class name with a capitalized letter
.
Seconded.

You could also take a look at JavaDoc for generating the class documentation.

But keep it up.
Play My Code - build games in your browser!