Java for PHP Programmers

Is there a book or a web site that has some tutorials on Java/JSP for PHP programmers? I used to do JSP but haven’t touched it in over 2 years and have crammed my head full of PHP and now I find myself needing to do some JSP work and I can’t remember crap!

I keep wanting to do stuff the PHP way and am getting really tripped up.

Any info would be wonderful!

Hi Chris,

Even i was in PHP for last 2 years and now i have switched to java. Rather i am working in Java Cocoon, struts etc. I actually can’t suggest u any book but be sure that if you are thorough in OOPS concept then u can easily migrate on JAVA. If you are aware of the OOPS concept implementation in PHP then it will be far easier for u to do that.

If you want something in ooops then you can use book written by “Timothy Budd” or “lafore” I don’t know ehe are you from but if you r from India then go for book by “balguruswami”

Let me know if u want anything else. And be sure that Java syntax is mostly similar to PHP few bits here and there.

I haven’t seen a Java for PHP programmers book (I’ve only seen .NET for Java developers), but there’s a very good book on Java - Core Java 2 it consists of two volumes.

There’s also a very good online book- “Thinking in Java” (use google). The best part is it’s free :smiley:

Here u go: http://www.mindview.net/Books/TIJ/

(thinking in java, 3rd edition), it’s totally free.

public class advice
{ public static void main(String args)
{ System.out.println(“Id say just learn from ordinary resources that people learning from scratch learn from. That way you cant miss out on anything.”);
}
}

Is there any manual where I can just learn Java just like how most of us learn PHP? I don’t even know what function is available in Java. Must we buy a book just for learning Java?

What’s the documentation like on the Sun site?

On Sun’s site you can find a very good tutorial:
Java Tutorial
and the API:
Java API

On this site: Java Almanac you will find a hundred examples of how to use specific Java classes.

However, I still recommend “Thinking in Java” to start learning.

Java is very different from php (though, php is catching up now) in as Java is object oriented and isn’t just a bunch of functions, it’s an Object Oriented Programming language (OOP).
It’s a very deep hierarchy of Classes, Interfaces, objects and methods and as such the java api (the equivalent to the php manual) is laid out to reflect this hierarchy.

On first glance you’ll be very confused looking at the javadocs, but once you understand OOP they’ll start to make more sense to you.

I understand OOP but it seems that I can’t find out what kind of methods available for each object.

I have j2sdk1.4.2_06 installed but I don’t find much help on starting developing simple Java applets or programs.

Try the Java API; I submitted the link a few posts ago.

No pain, no gain. Try downloading an IDE, like Eclipse or Netbeans, it will help you editing (code completion, for example). Get a book and start learning, the links given in this thread will suffice to begin.

You can use the java tool,editplus.I use it for compiling my java program.
It is easy to use.

I think the frustration that is being voiced here is that even if you can do OO in PHP, there is still a significant learning curve in moving from PHP to Java/JSP. Where is have difficulty is figuring out how to translate my advance PHP knowledge into JSP / Java. For instance, I have questions like, “How do I do the same sort of complex array manipulations in Java?” or, “How do I work with associative arrays?” or, “How do I do date arithmetic and conversions?” or “How do I do a certain kind of string manipulation?” The structure and syntax all seems very familiar, having worked in PHP, JavaScript and C. However, I find my lack of understanding of the built-in Java classes paralyzing, because for the most part I just want to jump in and code a web application with advanced features.

The other barrier that I have encountered is that most of the literature about Java web developement assumes a familiarity with the Java language. In other words, it is expected that you are a seasoned application programmer wanting to learn about Java’s web API. I personally could care less about Swing, AWT, Applets, etc. at this point. I want a text that tells me exactly what I need to know to write server-side web applications with a database interface, and tells me which of the numerous Java classes I need to gain in depth knowledge of in order accomplish that task. Nothing more. If I want to learn more later, I can work backwards from there.

Is that too much to ask? If anyone writes such a book, I will buy it!

Thread necromancy’s bad (5 month old topic), but here’s a little insight for ya.
Have you read the sitepoint articles for java/j2ee?
http://www.sitepoint.com/subcat/java