What is Java?
Fundamentally, Java is a programming language that allows people to write applets and executable applications. In a grander sense, Java is a platform, a full suite of tools and classes that allow a programmer to create dynamic applications for the web, for small devices like cell phones and PDAs, and for personal computers.Java has been around officially since 1996. In its eleven-year lifespan Java has evolved tremendously. It has spawned Servlet technology, component technology like JavaBeans, JavaServerFaces, and a whole host of tools. Despite all of these mysterious and complex offshoots, the core fundamentals of Java have remained relatively the same. In order to understand the Servlets and the beans, you will first need to get a firm grasp on the Java programming language itself.
What Makes Java Special?
Java is special for a few reasons. First, it is platform-independent. That means that you, as a Java programmer, will need to write your Java code only once. Before Javas heyday, programmers had to write their code for each targeted operating system (OS). If you wanted to write a poker game application and then distribute it to customers, you would have to write the program for the Windows operating system and again for the Mac operating system. You may even have to write code for each individual version of the Windows operating system (XP, Media Center, 2000, etc). That could really take some time. Lets say you did write 3 different versions of your program for Windows and at least one version for the Mac platform. Now you have four programs to keep up with. Not only do you have to write the program four times but now you must maintain and fix any bugs four times over. You are probably beginning to see the allure of a programming language that can tout platform independence.Java eliminates the problematic scenario above, once and for all. You write your poker application in Java, compile the application, and distribute it. As long as your users have a Java Virtual Machine (JVM) for their particular operating system, then your application will run on a Mac, Windows, UNIX, or any other operating system that has the correct JVM.
How does this magic of platform independence work? When you compile your Java programs, your code will be turned into bytecode. Bytecode is a stream of characters that a Java Virtual Machine can read and understand. Bytecode is the low-level instructions for the JVM. Each different operating system has its own JVM and the bytecode is interpreted by the JVM according to the needs of that operating system. In this way, you dont have to worry about writing your program for a UNIX operating system versus a Windows operating system. You can let the JVM worry about it instead.
Another special feature of Java is that it is object-oriented. Object-oriented programming allows the programmer to create templates (classes) that can be reused over and over. Every time you write a program, you dont want to reinvent the wheel, and creating well-designed classes will give you a great foundation for writing other programs. Also, Java has a core set of classes that are already provided for you. You can take advantage of these pre-built classes, and you have the ability to create classes from scratch. You can even use many of the pre-existing Java classes as a model to create customized classes of your own.
Java for Writing Applets
Applets are programs that run from a web browser window. If you have browsed the web, then you have probably run across an applet or two. You can use Java to create applets that act as games, calculators, quizzes, and numerous tools. The great thing about applets is that they are safe when compared to programs written in other common languages. Applets cannot access the file system of the computer they are running on. This greatly decreases the chances of getting a computer virus just from viewing an applet.
Java for Writing Executable Applications
In addition to creating applets, you can use Java to create standard executable applications. Executable applications are the typical software programs you install on your PC or Mac, such as spreadsheet software or photo editing tools. Java is an excellent language choice for these kinds of applications because Java, unlike many other programming languages, is platform independent.
What Java is Not
Java is a powerful programming language and much more, but over the years some people have become confused by Java. Java is not JavaScript. These two languages have little in common other than their similar names. JavaScript is a great scripting language that you can use for creating dynamic and interactive web pages, but you cannot create applets or full-fledged applications with JavaScript. Java is not a database or a data warehouse. You do not use Java as a data repository, storing records in tables. Java will allow you to access databases like Oracle, SQLServer, or DB2, but inherently you do not use Java as a place for storing large amounts of data.
