The first user-friendly tutorial on Java
This tutorial is a joint effort of
Mr. Vijay Mukhi
Ms. Sonal Kotecha
Mr. Shashank Tripathi
Men are amused by anything. That is why professional ice hockey is so
popular. That is why Disneyland runs into lengthier balance sheets than the
scientific museums. And that is why something like Java is touted as the next
Glasnost (well, unless you are a snoozebucket, you are probably aware of Java,
the new language that is bowling the world over). Make way. Here comes the stuff
our forefathers warned us about. It is mightier than the sword, the pen and
usually, the programmer. A thousand and one news-breakers and articles have done
their rounds on how Java is invariably an isotope of C++ minus the warts and
pimples, on how it is going to give the Internet an upbeat facelift, on
But wait. The last thing you want to do is to sit back and worship the
greatness of a language that has not even reached its final stages; you want to
use it. The one sad hitch with today's software is that the so-called tutorials
and manuals are scarcely meant for anyone to understand. Take the samples
bundled with Java for instance. How would you like the idea of brooding over a
hundred-line sample code to begin with? What these codes fail to do is spark an
interest among the wide-eyed newbies. ( Between you and me, I suspect that is
the state-of-the-art way of doing graffitti on aspiring programmers :) ).
And that's precisely what we aim to do here - to give you the first few sips
of Java (seasoned not to burn your tongue). Our approach is simple. As far as
possible, we will add a line at a time and expect you to try it out (if we
exceed that, we apologize). The worst thing that could happen by trying to learn
programming in this way is that we might lead to grazing down of a few more
trees (we will use more paper, right). But at least we can comprehend the
Undoubtedly, Java has flung open a whole slew of possibilities to spruce up a page on the Internet. Every little Johnny in the world, who has anything close to a GK, knows that Java can change lives. How is the question. Before we begin, let us make a few things clear. First, to learn programming in Java, it is undoubtedly a prerequisite to have a passing knowledge of C++ or we'd rather you sit over the weekend with a load of beer and cheetos in the fridge and atleast a dozen aspirins in the drawer :) . Secondly, the programs in Java here are explained in a simple, understandable manner and hence anybody expecting a display of rhetorical caliber is in for a disappointment of his lifetime. Just like an artist's potrait speaks for itself, we'd rather have Java speak for itself too. Third, while each concept is clearly explained, we prefer to keep our distance from the 'gears and cogs' of the language. And yes, it is also assumed you have downloaded the Beta versio! n of Java. (For those who came in late, the software can be downloaded from the address http://java.sun.com ). A point to be noted here is that we have worked on Windows 95 platform, though we are told the programs work in Windows NT and Solaris environments too.
Some Conventions that we swear by
" The essence of magic is simplicity "
We are not concerned with inculcating obedience or influencing the programming style of our readers; quite the contrary, we intend the development of initiative. The simplicity that will inevitably be exhibited in our code and explanation is merely a method to refrain from pedantic. The idea is not to win a prize in computer literature but to shorten your learning curve. The naming conventions that we will adhere to include:
- The variables that we use will be of one letter, for instance i, j, g etc.
- The functions will be of two letters, e.g., aa() , bb() etc.
- The class names will be three letters, e.g., zzz etc.
The Real Thing
Get yourself some reflections on Java...And
then the king leered . That done, lets dive right into the real
thing, head first.
Servlets - Jeeves , the Java Server
A Tweak of Lemon
- Threads The stretchy skeins of possibilities
- At Work Then ..Straight dope on the Abstract Windows Toolkit (AWT)
- Caught in the Net
...A sip of Networking
Statutory Warning : Nobody told you computers were going to be polite
- Miscellaneous Code Dump A throng of Beta applets tried out by us, but minus the explanation (because God forgot to make an applet that lets a day have more than 24 hours! :) )
- The C++ Connection Meant for the C++ clan, this section discusses the neglected (though inadvertently-hyped) issue "How Java is a sibling of C++".
- Of classes and interfaces When it comes to classes and interfaces , more often than not, the programmers are broke (or atleast badly bent!) Here's a whole caboodle on these elusive features of Java...
Making Monalisa wail... Pretty must be in the eyes of the beholder, but twiddling with
images is eminently compelling. As a slight deviation from twiddling with
the thumbs, lets get a dab hand at some intricate manipulation right down to
the level of the pixels of an image!
- Piddling with the image Coming to terms with the basics
- Some sludge about images
- The plot thickens Creating our own filter...whatever that means :)
- Giving Leonardo the goosies That's admittedly a treacherous thing to do, but if you can snoop around with each pixel, well, this might be the lucky break you have been plying for...
- Why MediaTracker
- The gears and cogs of MediaTracker
- Pixel Grabber
- Image Maps in Java
- Mastering the paint() and the update
- Living with the natives When C/C++ wish to date Java and party together.
- Knowing more about the natives
- Java odbc - Accessing the databases from java
- An interface to demonstrate Java-odbc
- A Tweak of Lemon