JAVA

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
micknic
Forum Commoner
Posts: 37
Joined: Thu Feb 27, 2003 1:27 pm
Location: belgium

JAVA

Post by micknic »

Hi guys

What are the differences between JAVA and PHP :?:


:P :lol: :o :D
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

Lots.

1. Java is compiled, PHP is interpreted
1a. No interpreter (ie--server) is necessary to run java programs
2. PHP is a scripting language (related to #1)
3. Java is fully Object Orientated, PHP is not
4. Syntax
5. Java can make non-webpage based applications. Technically so can PHP, but it is not really designed for it.
6. come to think of it, I should have just mentioned the similarities:
A. PHP and Java are programming languages
B. Both can be used in conjunction with HTTP to make web-programs
C. Both have similarity to C.

There is really not that much similarity between the languages. They are meant for different things.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

the java-vm could be considered as an interpreter as well, although there are differences. And there are tools that offer something similar to bytecode for php, too.
But one additional major difference comes to my mind: Java uses strong typing, e.g.

Code: Select all

public void func(java.nio.Buffer buf) { ... }
inside the function you can be sure buf somehow is an java.nio.Buffer, the method cannot be called without such an Object. In php you can pass anything anywhere and have to check it's type inside the function.
Post Reply