The only way I ever learn how to use something is to use it outright and not by code examples. Just doesn't work for me that way. So I went out and bought "The Complete Reference - Java Seventh Edition" -- it was the only one that had a beginners section, without the "ok, this is a computer". Just flipping randomly, chapter 11 covers multithreading ooo, that'll be fun. Chapter 17 covers the Java.util : the collections framework...25 deals with images, fun. 29, "Intorduction to Swing". Hmm.
----- Consider items from here on down my notes. ------
I've kinda skimmed over chapter 1-7 so far and I'm on chapter 8. So far, the syntax is almost 1:1. Console.WriteLine("string") == System.out.println("string"). Another syntax difference is inheritance. Inheritance in Java is called "extends". For instance in C# ...
Public Class Class1{ }
Public Class Class2 : Class1 { }
Class2 would inherit Class1. In Java, its similiar but different...
class Class1 { }
class Class2 extends Class1 { }
Not that bad, very easy so far. Method overriding seems to be exactly the same, no difference there. Same goes for making abstract classes and methods. There is however a "final" keyword that inhibits overriding. "final void SayHi();" would stop any inheriting class from overriding that method.
Chapter 9, Packages and interfaces -- Packages are like using includes/usings statements. I -think- they're DLL style items like in .net, you add them, give a reference in your app, carry on. Using statements are slightly different (more C/C++ style) -- import java.lang.*; for instance includes everything in the java.lang namespace and like C# you can use a fully qualified name if you wish, such as java.util.Date. Interfaces are the same too...
interface CallBack {
void callback(int param);
}
An interesting bit - "you should be careful not to use interfaces casually in performance-critical code" because of the overhead to create the objects.
Imagine that, there's a Try Catch Finally, exactly like in C#, even with the multiple Catch statements (say IOException and Exception). Same with throws AND threading. Wow this is becoming annoying, there's even a thread.Join (that means "wait for this thread to complete").
With that, I am stopping @ page 285. I'm keeping my false sense of empowerment until tomorrow or ...sometime soon.