Java book

Discussion in 'Mac Programming' started by Mr.Random, Aug 10, 2011.

  1. Mr.Random macrumors newbie

    Oct 31, 2009
    I would like to start with programming Java. Which book is best for beginners?

    I have a basic knowledge of C # programming (nothing special).

    Thanks in advance!
  2. Blakeasd macrumors 6502a

    Dec 29, 2009
    I liked Sam's Teach Yourself Java in 24 Hours
  3. larswik macrumors 68000

    Sep 8, 2006
  4. jiminaus macrumors 65816


    Dec 16, 2010
    I second Deitel & Deitel, Java : how to program, 9th ed.

    Another excellent book is Hortstmann, Big Java, 4th ed..

    Both of these spend lots of time teaching object-orientation and algorithm development, in addition to Java syntax and Java library usage.
  5. larswik macrumors 68000

    Sep 8, 2006
    Since we are on the Java topic. I don't think I can use Xcode for Java? Is there a recommended IDE to use for my class?

  6. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    I'd stick to a text editor if you are just starting out. MacVim is my choice but any text editor will do (emacs, Text Wrangler, TextMate etc etc). If you absolutely must use an IDE then the choice is either Eclipse, Netbeans or IntelliJ IDEA (there is a free community version).
  7. larswik macrumors 68000

    Sep 8, 2006
    Thanks, I think I would like to compile the code to make sure it works. I don;t think I can do that within a text program. I will download one of those, thanks!
  8. kurayama macrumors newbie

    Jul 2, 2011
    If you're starting, I recommend BlueJ.
    It's the one I've used in my classes.
  9. jpyc7 macrumors 6502

    Mar 8, 2009
    Denver, CO
    I have only used Eclipse as an IDE, but the cool thing about it is that I can use it with languages other than Java by installing plugins. It's strength is definitely Java development.

    Of course, the non-typed languages I've used in Eclipse (Python and Perl) don't really need features like source code refactoring.
  10. mmendoza27 macrumors 6502

    Oct 18, 2007
    I use Coda and TextMate to program in Java. I think it works great and they are very customizable because you focus solely on the code, instead of all the features of the IDE (which may benefit you depending on your project). In the case of compilation, you would just compile with terminal. In terminal, use cd to get to the directory where the files are located at (you could start by putting them on the desktop) and then you compile them with Terminal.

    In this case, you would type:

    javac <NameOfFile>.java [ENTER]
    java <NameOfFile>
    "javac" starts the gcc compiler and will give you any compile-time errors. Believe me, they'll be confusing either way, through IDE or Terminal. Terminal also gives you the line code it's at just like the IDE. You can't use "java" until the program has successfully compiled.

    Again, I prefer it because it's lightweight, less cruft and eventually I'll move to an IDE once I work with big projects but I'm just programming command-line interfaces and learning the UI stuff slowly.
  11. wpotere Guest

    Oct 7, 2010
    The book I learned off of is JAVA: An introduction to problem solving and programming by Savitch. I love this book and highly recommend it. The others listed are also great books.

    ISBN : 0-13-149202-0

    With JAVA I often find that it is easier to teach folks how to start with a simple text editor and then move into an IDE. The main reason for this is that with an IDE like Netbeans or Eclipse, it can be hard to understand what is happening behind the scenes and you can also pickup some bad habits. That being said, I do know a few people that started with them and they are decent programmers now.

    If you have some C# then JAVA shouldn't be to difficult to pick up.

    New edition... Java book by Savitch
  12. talmy macrumors 601


    Oct 26, 2009
    Using an IDE gives easy access to the Javadocs for the system (as well as the source code for the library if you are curious) and eliminates virtually all need for reference books. That said, a standard text editor plus the command line is basically all that is necessary to start.

    I've been programming in Java for over 12 years, mostly Swing apps, and now use Netbeans, which I also use for C++ and Qt 4 programming. Its a very conventionally designed IDE. Most people I know find Eclipse bloated and confusing. What the heck is a "perspective" anyway? (I ask rhetorically.)

    Recommended book: Thinking in Java by Bruce Eckel. Perfect for one with some C# or C++ experience but not good for programming beginners.
  13. macsmurf macrumors 65816


    Aug 3, 2007
    IMHO, the best Java IDE out there is Intellij IDEA, but I would recommend against using it for a beginner. A text editor + terminal is the best way to learn. Once you've used that for a month or so you can go with the IDE of your choice.
  14. larswik macrumors 68000

    Sep 8, 2006
    I will try them all out and see which one works for me. I read the first few pages in the book for my class and it almost feels like I am reading the Objective-C book since they talk about Classes and Methods and it evolved from C++ which evolved from C.

    Are there any big differences from Objective-C and Java?

  15. talmy macrumors 601


    Oct 26, 2009
    Totally different approach to objects in Objective-C. Objective-C is C with a Smalltalk-like extension for objects. C#, which you mentioned, is like a merge of Java and C++, and so Java is easy to pick up from that point of reference.
  16. larswik macrumors 68000

    Sep 8, 2006
    OK so I will need to think about it a little differently even though they use the same terminology like Classes and Methods and so on. The book is 1500 pages or so, it should be fun.


Share This Page