Picking Modules - What's Java like?

Associate
Joined
2 Nov 2007
Posts
488
Hey,

Im looking at my modules at next year (im doing a Physics based course) and the computing module has caught my eye for a few reasons:

  • Ive got a fairly alright with (and enjoy using) computers
  • Im fairly proficient with HTML / CSS / JS / PHP
  • Java actually seems useful in the real world
  • (There is no end of year exam!)

I was just wondering what Java as a language is like? Would a background in PHP help me pick it up? Is there anywhere i can be looking online for some basic tutorials to get me introduced (remembering i have NEVER used Java before)?

Cheers for any input

(To put it into context, this is the course description:

Aims of the Course:
• give the student an introduction to the use of object-oriented (OO) programming in the context of physics data handling and analysis situations;
• give the student sufficient programming expertise to be able to design and implement simple analysis programs such as would arise in 3rd year laboratories and 3rd and 4th year project work.
The programming exercises will use the Java language.

Objectives:
The objectives of the course have three broad categories:
1) Basic program control & OO concepts/design
The student will become familiar with the following OO programming concepts, which are used widely in all OO languages:
• in-built data types and their manipulation;
• algorithm steering elements;
• user-defined data types: classes and objects;
• manipulation of objects using methods;
• constructors and destructors;
• polymorphism / method overloading;
• inheritance, abstract methods and interfaces.

2) Implementing the most widely used Java programming tools
The student will become familiar, using the Java language, with the code and concepts, required to:
• input and output data (to screen and files);
• organise lists and other collections of objects using Java collections;
• handle program exceptions;
• create a multi-threaded application;
• create a simple graphical interface.

3) Program Design and Applications
The student will become familiar with:
• how Java runs programs: JVM;
• Java packages, jar files;
• constructing a multi-faceted program;
• applying programming concepts to physics analysis and modelling situations.

Finally the student will have a working knowledge of the principal differences between OO programming using Java and using the C++ language.)
 
Both Java and PHP are C like languages so you will already know a lot of the syntax. So in that sense then you will probably be there with the layout and general of the language right away. If you have ever used an OO approach in PHP then you will probably have no problem picking it up in Java.

Although I learnt the basics of java at uni i didn't keep any of the slides and tuts and i don't know any decent tutorial sites. But you may be best starting off looking at http://java.sun.com/ I believe they have a decent selection of tutorials.

On the IDE front i would recommend getting Eclipse over Netbeans (netbeans has too much going on in the GUI!) or use a basic based text editor - i prefer Notepad++.
 
Java is fairly easy to pick up, as mentioned Eclipse is really quite a nice IDE for it (although I've never used Netbeans or any of the others). The API makes a lot of things very easy, and yes some PHP knowledge will certainly give you a decent grounding, OO itself could be the 'hardest' bit depending how you've used PHP (it can be both OO and 'functional decomposition' style), but even then it's not a huge challenge to do OO, just a slightly different way of approaching the problem.

That last bit does interest me though 'principal differences between OO programming using Java and the C++ language' almost makes it sound like C++ isn't OO (which I guess it can be non-OO, but it can also be just as OO as Java can), but meh, that's pretty irrelevant :p
 
It'll probably be more structured than the web stuff you've done so ideally would teach you some new good practices.

That last bit does interest me though 'principal differences between OO programming using Java and the C++ language' almost makes it sound like C++ isn't OO (which I guess it can be non-OO, but it can also be just as OO as Java can)
Is it ever truly OO/encapsulation-friendly if a dodgy pointer can ride roughshod over the guts of another object at runtime?
 
Thanks for the replies.

I keep hear OOPHP being thrown around but never understood what it actually meant. The only expierence i have had with PHP if your average regex, arrays, contact forms etc. What does OO actually entail?
 
I come from a webby sort of background and have also started a java module this semester.

I'm just over half way through and everything I've learnt so far (vars, loops, methods) has been very easy to understand. In fact as soon as I could see the syntax it was simple to guess how to make it work, I'm sure it will be for you too.

I've never looked into what OO really means. Is it like 'modular'?
 
I did Java, I wasn't really keen on it really, I think I would have preferred C++ but I didn't have a choice... :( It comes down to personal preference however, you may prefer Java if you want to write multi platform code. :)
 
Java's really nice to learn and leads you into C++ later if you are so inclined. Your experience with HTML etc means you already have a good understanding of syntax and structure. Should be good :)
 
Thanks for the replies... seems quite encouraging.

This may sound a bit stupid, but could someone post an example of some basic Java code (Hello World, for example) so i can just get a feel for what it looks like?

Cheers
 
public class HelloWorld
{

// non executable comment blah blah blah

int myInt = 10; // declares an integer with value 10


public static void main (String[] args) // main method of execution
{
System.out.println("Hello, world!, my first int is "+myInt);
// prints strings and other stuff ^^
}

}

Outputs:

Hello, world!, my first int is 10
 
Back
Top Bottom