Java Programming

Computing &Math. Sc. -university of Greenwich FM’- University of Semen -BBS Informatics JAVA Programming Lecture 1 March 2007 Lecture notes by Dillon Edwards, presented by Stance How do you learn? Programming is very obviously a task-oriented activity and the only way to learn is by doing it. Get as much practice as you can by trying all the exercises and don’t be afraid to try out your own ideas by modifying some of the examples. You can learn a certain amount from online tutorials and by reading through examples and trying to make sense of them.

So please do this. The main thing is to be patient! – Java is very gig and very powerful and so inevitably takes time to learn. Each week we’ll go through a batch of notes in class, do some tutorial exercises and get some work done in the lab. Please note that this course will not make you into a Java programmer but it will give you an introduction and feel for what it meaner to be a Java programmer. Don’t be discouraged by the complexities, it will all gradually become clear! What do you need ? Not much! Just The essential software tools -JDK or SAD and a plain text editor like Notepad Determination to learn Willingness to keep trying when things don’t work at first Optional Resources Books – you don’t have to buy one but they are always useful and there’s a lot to choose from. Web sites wry. Java. Sun. Com Sun web site The best place to find out more about Java web development is of course the web. Try typing Java into search engines and visit the following sites. Www. Cassavas. Com wry. Developer. Com www. Savonarola. Com www. Gametal. Mom Software Tools for Java Here are some Integrated Development Environments and other tools to make it easier to develop Java programs (but we won’t make specific use of them in this course): IBM Vassalage for Java Inverse Borderland Jubilees Microsoft Visual J++ Symantec Visual Cafe© What is Java? Www. Software. IBM. Com/ad/VA]VA www. Inverse. Com/]builder www. Microsoft. Com/visual] www. Symantec. Com/domain/cafe It is an POP (Object Oriented Programming) language developed by SUN (1990). Now on Version 2 it is widely used for the development of internet (and other distributed) software.

Hire a custom writer who has experience.
It's time for you to submit amazing papers!


order now

Its features include architectural neutrality, security, robustness, multi- threading and it offers extensive Apish including Guise, utilities, database access, networking etc. What can you do with it? You can 1 . Download ready-made applications (“APPLETS”) from other sites and embed them onto your own HTML pages. (e. G. Try www. Gametal. Com and download some of the . Class files) 2. Write your own applets and embed them in your web pages. 3. Produce stand-alone applications unrelated to the internet. 4. Produce things called Jabberers which are roughly analogous to Visual Basic controls or Class modules for carrying out specific tasks.

We will consider only the first two of the above. Applets can considerably enhance your web pages and provide extra interaction, sound, animation, graphics etc. Examples are games and programs to provide insurance quotes. They are best kept fairly small otherwise the download time can be Eng and put users off. With Java you can write an internet program to perform Just about any task and because (once downloaded) the Java program runs on the client’s own PC , it is as fast as any application on the local PC’s hard disk. How does it work?

Java was created by Sun Microsystems with the aim of producing platform- independence. This was achieved by making compiled Java programs (architecturally neutral botched) run on a JOB Cave Virtual machine) so any PC with the JOB installed can run Java programs. The JOB is built into Netscape Navigator and Internet Explorer hence the importance of Java for Internet. We are now on Java. Java source code (which can be written in any text editor) is passed to the Java Compiler which checks the code for errors and gives a report if it finds any. When there are no errors it produces a Java class file (machine code).

Depending what it was intended for, this file can either be run as a stand alone application or (if it is of the right kind) it can be added too HTML document using either the tag (the old way) or the tag (the future). When a browser comes across one of these tags it downloads from the server the compiled version of the applet ( the . Class file) along with any other classes the applet deeds. Creating your own Applets Incorporating a Java Applet into an HTML document involves the following steps: 1 . Writing the Java source code – saved (by you) as Filename. ]VA. 2. Compiling the Java program – saved (by Java) as Filename. Lass 3. Putting an or tag on your web page. 4. Viewing the web page with the Java applet embedded in it. Another step could be placed between 2 and 3 : Viewing your Java program on its own in Java’s appellatively. The software tools you need to let you develop Java programs are packaged into the Java Software Development Kits (Kids)or Java Development Kits Odds). In the labs you household be able to find JDK Versions . 3. 1 on the Novel. Applications Launcher. You will also find the Java KIDS . 3. Non our CD. If you buy one of the more expensive books you will very likely get a CD with the SAD on it too.

If you are online at home you can download free copies of JDK and Kids from www. ]vast. Com/products/ but be prepared for a long wait. Get JDK 1. 3 if you can. The JDK contains java. Exe The Java Compiler The Java Virtual Machine java. Exe appellatively. Exe The Java applet viewer JDBC. Exe The Java debugger The Java decompiled java. Exe Java. Exe The Java documentation These are “command-line” programs (very old technology dating back to probably before you were born! ) requiring commands to be typed in rather than by mouse clicks. If you are working at home; After installing the JDK you will have a folder called JDK . . 1_01 Bin (or maybe Java Bin) which is where you will tint the above mentioned tiles. It you can’t tint it d Search, Java. If you haven’t done it before it will be a good idea to get familiar with what used to be called an MS-DOS window but is now Command Prompt. If you think you haven’t got one do Start, Run and type command. Alternatively click Start,Programs,Accessories. MOOS is powerful and can be used to delete files and even format your hard drive so you should at least get yourself a little experience with it. It may also be worth putting a shortcut on your start menu or desktop.