I'm realizing my main problem with Java is learning by Google sucks. You end up learning stuff in mish mash order, typically without understanding the foundation the google solution provides. Which means when it no workie you have no idea why.
So. Can anyone recommend a book or website that will teach me Java, *with problems*? The 'with problems' is key, otherwise I'll jump around the book like I do in google. I need to be spoon fed a couple pages, then given a few programs to write. over and over.
For background, I've been programming for 40 years (Action lawn = new Action("Get off my");). Started Basic on a TRS-80, went to z-80 assembly, then 8080 assembly, engineering found me writing test scripts and drafted me (I was 21 at the time), learned 8086, then C, then pretty much everything in a Unix environment. So I've got lots of experience, not much in Java.
My immediate problem is I've got 2 maps, 1 map's keys are a subset of the second maps. I'm using the key to get the values of each map. Problem is, for one of them the Map.get(key) is returning the bloody key. sigh. Code below, don't have time to make a standalone program out of it. Not to mention, that isn't the point to this post. I want to learn how to figure out this crap outside of posting on forums.
In the first debug block frequency.get('e') returns the correct value. But the line Integer observed = frequency.get(key); is returning the key, which means my chi squared is garbage.
I'm studying for the Oracle Certified Associate Java SE 8 Programmer I certification, and the first thing I noticed is that I really like the book(Boyarsky/Selikoff). So many books of late are over 1000 pages long. That has become way too much for how the world works.
The exam prep book is 340 pages(the book for the first level cert anyways), gets right to the point of what you need to know for the exam and absolutely no blah blah blah. There are six chapters with 20-30 questions each. You can think about the answer, then compile them yourself to see if you're right. The website for the book comes with three practice exams that you could type up and work on as well. The problems aren't huge though, so I don't know if that's what you're looking for. After all, you don't actually need a compiler to answer the questions. But typing them up really helps you learn it.
I have tried reading Thinking in Java and it couldn't hold my attention. I slogged through Core Java. That was better, but still, I think it's a tough way to learn. The exam book is concise. And the exam itself, I can say, is not easy. I feel I will be a better Java programmer for taking it and this little book is the key.
If you're not on the exam path, you'd whip through this book pretty fast. The next level exam(Programmer II Study Guide: Exam 1Z0-809) is 720 pages long and covers more advanced material. I can't speak to it but it's the same authors so I assume the same quality and experience.
And I also only noticed, just now, that the same authors sell an additional prep book with 1000 questions.