I've been working with php for years, but I'm looking forward the Android development with Java and I think I need to know very well Java before a start with Android. Do you have some tips or some recommendations for me to learn Java?
Understand the philosophical differences. Most notably, Java has static typing, and strong focus on object-oriented programming. So learn about:
Inheritance (only single parents), abstract classes/methods, final classes/methods, interfaces, delegation, private/protected/public...
Static typing, polymorphism, generics...
How to use an IDE (my favorite is IntelliJ) with Java. I.e. automatic refactoring is easier with static types. Also look into debugging, realize that if you read obj.method() and obj is of type Vehicle, that doesn't mean Vehicle::method() will be called, it could very well be a subclass's method (like Car::method()).
How to compile your programs and install dependencies, using Gradle for example (or Maven).
You'll need to know some of the details like
Checked / unchecked exceptions ()
Override vs overload
Primitives (int, bool) vs objects (Integer, Boolean)
Java generic problems: type erasure, raw types
You should also consider Kotlin instead of Java, it's easier and more expressive (while still pretty similar).
You might want to know a little about annotations, but don't need to know how they work internally.
Also go over some conventions. E.g. some companies never use checked exceptions, use @Nullable/@Nonnull everywhere, @Override, prevent or encourage primitives, mark everything as final and private unless necessary...
I'd personally recommend against official certificates, I found them to be a waste of time (it might help in interviews, but it's not a good way to learn).
This is kind of a random sample of some Java things, I can't really go over the whole language, sorry... There are many resources online though!
Mark
Some random things:
Understand the philosophical differences. Most notably, Java has static typing, and strong focus on object-oriented programming. So learn about:
How to use an IDE (my favorite is IntelliJ) with Java. I.e. automatic refactoring is easier with static types. Also look into debugging, realize that if you read
obj.method()andobjis of typeVehicle, that doesn't meanVehicle::method()will be called, it could very well be a subclass's method (likeCar::method()).You'll need to know some of the details like
You should also consider Kotlin instead of Java, it's easier and more expressive (while still pretty similar).
This is kind of a random sample of some Java things, I can't really go over the whole language, sorry... There are many resources online though!