To talk on Icrontic, just register!

It only takes 30 seconds.

Have an account? Sign in:

Forgot?
Tropical
looking for something to do
Tropical
87 Posts

Java for my AP class

I taking AP computer Science (AB for 1337 h4x0rz ) 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?
karatekid
All Three Baby
karatekid
546 Posts
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 (here.) 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 ;[.
__________________ War doesn't determine who's right, just who's left.
GTA:VC: " On the toll road of life, you have to pay to prove you can"
Hulac: "Politicans are liers. They are actors with bad hair cuts."
Geeky1
No comment.
Geeky1
7,972 Posts
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...
__________________ -MCCCXXXVII
"Ignorance is forgivable. Stupidity is inexcusable."

Resident Dual CPU Addict: 3 working duallies, 2 more in the parts drawer, and looking to add an Opteron dually to that list as soon as I can find a good motherboard...
a2jfreak
madasiemanym
a2jfreak
3,351 Posts
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.
__________________
One thing kids like is to be tricked. For instance, I was going to take my little nephew to Disneyland, but instead I drove him to an old burned-out warehouse. "Oh, no," I said. "Disneyland burned down." He cried and cried, but I think that deep down, he thought it was a pretty good joke. I started to drive over to the real Disneyland, but it was getting pretty late.
Jack Handey
[folding_sig1]Child Search Ministries.
A Christian Charity for Missing Children.

Get Firefox!
Tropical
looking for something to do
Tropical
87 Posts
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

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
karatekid
All Three Baby
karatekid
546 Posts
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 here
Tropical
looking for something to do
Tropical
87 Posts
i guess don't judge a book by its sources? ha ha ha...that's pretty lame. thanks for the info
Sicarius
|337/\/355
Sicarius
8 Posts
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.
__________________ Fighting for our freedom means we need to fight for our rights.
Sicarius
|337/\/355
Sicarius
8 Posts
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.
qparadox
I'll Think of Something
qparadox
814 Posts
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 . Just wait till you get to file output. How I love Java.
Go Back   Icrontic Forums > Tech: Software > Web & Digital Media
Jump to
This Thread Search this Thread
Search this Thread:

Advanced Search


Current time: 7:35pm (GMT)
Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Get Vanilla instead. Trust me.