although php and java have classes, they are not the same language and
they are designed for different paradigms.
java is for cross platform, where as php is designed for unix/windows.
php is very different in nature. mysql connections are opened and not
closed until the program ends, which is usually a second or two. java on
the other hand should close the mysql connections when ever a
method/object ends, i prefer to use methods as classes do not have a
desctor as such, the garbage collector handles that.
im sorry, but they are very different langauges.