Java for my AP class

edited October 2003 in Internet & Media
I taking AP computer Science (AB for 1337 h4x0rz :D) next semester and i just found out that the nice people that makes the AP exams changed the language from C++ to Java!!!!!!!!!! Now I have to learn Java! Anyways my teacher gave a book so I can do some indepent studies but the books sources don't compile on the SDK so anyone nows a good book to learn Java?

Comments

  • karatekidkaratekid Ogdensburg, NY
    edited October 2003
    Wait, they give you code that does not compile? Could you provide an example? Seems like they would give you samples that actually work.

    The book I use in independent study is Java Software Solutions, AP Version (<A HREF="http://www.awprofessional.com/isapi/product_id~{4DE581DB-F181-4A42-9963-DC00C85A9D45}/catalog/product.asp&quot; target=_blank>here</A>.) Frankly, there has to be a better book out there. The information presented is ok, but it is presented in a very bland, robotic manner. There are plenty of examples of code, but very little in the way of problems that you actually have to solve. Also, some concepts or classes are mentioned (for example, the number format class) that then seems to never get mentioned again in the book ;[.
  • Geeky1Geeky1 University of the Pacific (Stockton, CA, USA)
    edited October 2003
    Going from C++ to Java shouldn't be all that difficult. I took a JAVA class a few years ago (and did awful in it), and I'm taking C (not C++) now, and the two are pretty similar...
  • a2jfreaka2jfreak Houston, TX Member
    edited October 2003
    The two are similar syntactically, but aside from that Java and C++ go about things differently. Java's a decent language and definitely has a purpose but I personally am not very crazy about it and prefer C++.

    As for your question about good Java books? I would say WROX should have some good books and Sams often has nice books too. Honestly though, the best book is the one that reads well to you and you can understand. Go to a book store and grab a few books and sit down with them and read a little bit from each and see which author has a style that best suits you.
  • edited October 2003
    After reading this review ( link ) i found out why it didn't compile under netbeans: it uses third party packages! no wonder i couldn't compile, This book sucks :mad:

    karatekid here is an example:
    //Program converts fahrenheit into celsius
    import TerminalIO.KeyboardReader;

    public class Convert {

    public static void main(String [] args) {
    KeyboardReader reader = new KeyboardReader();
    double fahrenheit;
    double celsius;

    System.out.print("Enter degrees in Fahrenheit: ");
    fahrenheit = reader.readDouble();

    celsius = (fahrenheit - 32) * 5.0-9.0;

    System.out.print("The equivalent in Celsius is ");
    System.out.println(celsius);

    reader.pause();
    }

    }

    As you can see the teminalio doesn't even exist under the STANDARD java package! Making this book useless for the AP test (I think).
    Also if you think your book is lame my is TEN times as worse and is very disorganize. Anyway the book is called Fundamentals of Java by Lambert and Osborne and is the WORSE book ever. I also think that Java sucks (not all the time) and I also prefer C++ over Java. At least I going to be able to program my own cell phone games when I finish :D
  • karatekidkaratekid Ogdensburg, NY
    edited October 2003
    Yup, third party classes will do it. First off, the book does not suck cause it uses the third party class. My AP book also uses a third party package (cs1.jar). The book says that reading keyboard data in Java is somewhat difficult and that the book will explain eventually (although I am up to chapter 6 out of 9 and I have yet to see mention of reading from the keyboard.) To get the program to work right you will have to find the package file and put it into C:\j2sdk(versionNumberHere)\jre\lib\ext and C:\Program Files\Java\j2re(versionNumberHere)\lib\ext.

    If you can't find that TerminalIO package (though a search in google should bring it up) I can send you the cs1 package. It is pretty straight forward, you don't even need to create a cs1 object, you can just call the methods though the class name (static methods.) On the down side, I am guessing TerminalIO does more than just read from the keyboard, while that is all the cs1 does.

    Edit:// Actually, you can download TerminalIO <A HREF="http://shiegz.tripod.com/java/jfiles/TerminalIO.jar">here</A&gt;
  • edited October 2003
    i guess don't judge a book by its sources? ha ha ha...that's pretty lame. thanks for the info :thumbsup:
  • SicariusSicarius Columbus, OH
    edited October 2003
    I used the book "Java: An Introduction to Computer Science & Programming" by Walter Savitch in my college class at DeVry. It was a pretty good book. But I think the book "Big Java" by Cay Horstmann was a great book. I learned a lot from it.

    If you are doing independent studies try to rewrite some of the java libraies. It is really hard but you can view the source code of them too. You can learn more by trying to rewrite that after getting the basics down, I think.
  • SicariusSicarius Columbus, OH
    edited October 2003
    I used the book "Java: An Introduction to Computer Science & Programming" by Walter Savitch in my college class at DeVry. It was a pretty good book. But I think the book "Big Java" by Cay Horstmann was a great book. I learned a lot from it.

    If you are doing independent studies try to rewrite some of the java libraies. It is really hard but you can view the source code of them too. You can learn more by trying to rewrite that after getting the basics down, I think.
  • qparadoxqparadox Vancouver, BC
    edited October 2003
    I/O in java is generally a PITA, for some reason (i understand the methodology but still think its stupid) the Java designers decided to take a lot of simple things and not create standard functions/classes for them. This means just reading from the keyboard requires something like 8 lines (IIRC) if you want to do it without some 3rd party class. Such is the evolution of the programming language, what used to be one simple function call is now 8 lines :D. Just wait till you get to file output. How I love Java.
Sign In or Register to comment.